Limit dg-xfail-run-if for *-*-hpux11.[012]* to -O0
[official-gcc.git] / libphobos / testsuite / libphobos.thread / join_detach.d
blobf1515190171f022ec170bb159b077cd614ac4168
1 import core.thread;
2 import core.sync.semaphore;
4 __gshared Semaphore sem;
6 void thread_main ()
8 sem.notify();
11 void main()
13 auto th = new Thread(&thread_main);
14 sem = new Semaphore();
15 th.start();
16 sem.wait();
17 while (th.isRunning()) {}
18 destroy(th); // force detach
19 th.join();