digitalmars.D - Suspend/Interrupt threads
- Nrgyzer (7/7) Jan 30 2011 Hey,
- Sean Kelly (4/11) Jan 30 2011 Have the thread call sleep() or use a semaphore or mutex. If you want t...
Hey, how can I interrupt/suspend threads in D2? core.thread only provides start(), join() and similar, but nothing like interrupt() in JAVA. I have a thread which sleeps for some seconds. Does join() interrupts the Thread.sleep()-call? I don't want that the user have to wait some seconds because a thread is running, but sleeping. Thanks in advance!
Jan 30 2011
Nrgyzer Wrote:Hey, how can I interrupt/suspend threads in D2? core.thread only provides start(), join() and similar, but nothing like interrupt() in JAVA.Have the thread call sleep() or use a semaphore or mutex. If you want to suspend a thread and have it be interruptable use a mutex combined with a condition variable (from core.sync).I have a thread which sleeps for some seconds. Does join() interrupts the Thread.sleep()-call? I don't want that the user have to wait some seconds because a thread is running, but sleeping.It doesn't interrupt the sleep() call if the thread is sleeping. join() simply waits for the thread to terminate normally.
Jan 30 2011