152419Sjulian// Bugzilla 11309 - std.concurrency: OwnerTerminated message doesn't work 252419Sjulian// We need to assure that the thread dtors of parent threads run before the thread dtors of the child threads. 3139823Simpimport core.thread, core.sync.semaphore; 4139823Simpimport core.stdc.stdio; 5139823Simp 652419Sjulian__gshared Semaphore sem; 752419Sjulian 852419Sjulianstatic ~this() 952419Sjulian{ 1052419Sjulian if (sem !is null) sem.notify(); 1152419Sjulian} 1252419Sjulian 1352419Sjulianvoid main() 1452419Sjulian{ 1552419Sjulian sem = new Semaphore; 1652419Sjulian auto thr = new Thread({assert(sem.wait(1.seconds));}); 1752419Sjulian thr.start(); 1852419Sjulian} 1952419Sjulian