How to stop the Threadmill

Chris wendlec at tcd.ie
Mon Jan 28 02:18:26 PST 2013


I am sure this has been asked before, but I couldn't find a 
solution or a hint via Google: I use a separate thread to play a 
sound file. Everything works fine, except that I cannot tell the 
thread to stop what it is doing. It refuses to receive messages 
while it is doing what it's doing (even if I just run a simple 
test function with a long for-loop to make sure it's not a 
hardware issue). I should probably add that the thread is started 
from within the main loop of a socket that waits for input. If 
the input is "stop" it should tell the play-thread to stop, but 
nothing happens.
I can imagine that the thread is no longer visible to the 
main-thread, although I keep a reference to it. Any help or hint 
will be appreciated.


More information about the Digitalmars-d-learn mailing list