Just use non-blocking receives in main thread's event loop. When you get a message from child thread that it's finished playing and you decide you don't need that thread anymore, send a message to child "you're dismissed". The child should also have some loop to check for incoming messages non-blockingly. Upon receiving such message it should exit.

Reply via email to