From 140ea5ed84cb9356b928ee41e422b6e07d8818e3 Mon Sep 17 00:00:00 2001 From: hiker Date: Thu, 16 Oct 2014 08:21:26 +1100 Subject: [PATCH 1/2] Update comments. --- src/audio/sfx_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/sfx_manager.cpp b/src/audio/sfx_manager.cpp index b836d25ea..6374c401d 100644 --- a/src/audio/sfx_manager.cpp +++ b/src/audio/sfx_manager.cpp @@ -213,7 +213,6 @@ void SFXManager::queueCommand(SFXCommand *command) m_sfx_commands.lock(); m_sfx_commands.getData().push_back(command); m_sfx_commands.unlock(); - // Wake up the sfx thread } // queueCommand //---------------------------------------------------------------------------- @@ -224,6 +223,7 @@ void SFXManager::queueCommand(SFXCommand *command) void SFXManager::update(float dt) { queue(SFX_UPDATE_MUSIC, NULL, dt); + // Wake up the sfx thread to handle all queued up audio commands. pthread_cond_signal(&m_cond_request); } // update From c61b7d632df0938afb6a9b920a4b7c3cb5bbd373 Mon Sep 17 00:00:00 2001 From: hiker Date: Thu, 16 Oct 2014 12:48:48 +1100 Subject: [PATCH 2/2] Fix stk hanging on exit. --- src/audio/sfx_manager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/audio/sfx_manager.cpp b/src/audio/sfx_manager.cpp index 6374c401d..40eadb184 100644 --- a/src/audio/sfx_manager.cpp +++ b/src/audio/sfx_manager.cpp @@ -234,6 +234,8 @@ void SFXManager::update(float dt) void SFXManager::stopThread() { queue(SFX_EXIT, NULL); + // Make sure the thread wakes up. + pthread_cond_signal(&m_cond_request); } // stopThread //----------------------------------------------------------------------------