Condition Mutexes

Bartosz Milewski bartosz-nospam at relisoft.com
Wed Oct 21 11:40:56 PDT 2009


dsimcha Wrote:


> void main() {
>     condition = new Condition( new Mutex() );
>     auto T = new Thread(&waitThenPrint);
>     T.start();
>     condition.notify();  // Never wakes up and prints FOO.
> }

Your program terminates immediately after sending the notification. You need to stall the exit until the other thread has a chance to wake up. 



More information about the Digitalmars-d mailing list