Limit dg-xfail-run-if for *-*-hpux11.[012]* to -O0
[official-gcc.git] / libphobos / testsuite / libphobos.init_fini / thread_join.d
bloba40cd5ebe0431f970565445c7e7129f2c6b15162
1 // Bugzilla 11309 - std.concurrency: OwnerTerminated message doesn't work
2 // We need to assure that the thread dtors of parent threads run before the thread dtors of the child threads.
3 import core.thread, core.sync.semaphore;
4 import core.stdc.stdio;
6 __gshared Semaphore sem;
8 static ~this()
10 if (sem !is null) sem.notify();
13 void main()
15 sem = new Semaphore;
16 auto thr = new Thread({assert(sem.wait(1.seconds));});
17 thr.start();