On Thursday, 7 August 2014 at 05:58:50 UTC, Don Viszneki wrote:
I think perhaps I need to give D the opportunity to clean up SDL2's audio thread before shutting it down?

I added a new message that is sent first to my audio thread from the main thread when shutting down, and then it is sent from the audio thread to the main thread as acknowledgement.

In audio thread:
    (MessageShutdownAudio msg)
    {
      send(mainTid, MessageShutdownAudio());
      thread_detachThis();
      SDL_PauseAudio(1);
    }

In main thread:
  send(audioTid, MessageShutdownAudio());
  receive((MessageShutdownAudio bye) { /* do nothing */ });
  SDL_CloseAudio();

Reply via email to