Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tango.core.Thread;
- import tango.io.Stdout;
- Object x;
- static this() {
- x = new Object;
- }
- void thread_main() {
- synchronized(x) {
- throw new Exception("Oh no you don't");
- }
- }
- void main() {
- auto t = new Thread(&thread_main);
- t.start();
- for (auto i=0; i < 1000; i++) {
- synchronized(x) Stdout(i).newline;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement