How to stop the Threadmill
Steven Schveighoffer
schveiguy at yahoo.com
Tue Jan 29 09:38:47 PST 2013
On Mon, 28 Jan 2013 05:18:26 -0500, Chris <wendlec at tcd.ie> wrote:
> 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.
Threads do not automatically receive messages. You have to check for them
periodically.
Messages go into a mailbox until you query for them.
-Steve
More information about the Digitalmars-d-learn
mailing list