From 72a6b137ba256f5198843f8980107c350d52e5ca Mon Sep 17 00:00:00 2001 From: Ariel Manzur Date: Mon, 21 Dec 2015 09:01:40 -0300 Subject: [PATCH] audio threads --- servers/audio/audio_server_sw.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/servers/audio/audio_server_sw.cpp b/servers/audio/audio_server_sw.cpp index d20e2d42e05..8ab220d189c 100644 --- a/servers/audio/audio_server_sw.cpp +++ b/servers/audio/audio_server_sw.cpp @@ -30,6 +30,10 @@ #include "globals.h" #include "os/os.h" +#ifdef NO_THREADS +#define NO_AUDIO_THREADS +#endif + struct _AudioDriverLock { _AudioDriverLock() { if (AudioDriverSW::get_singleton()) AudioDriverSW::get_singleton()->lock(); } @@ -803,7 +807,7 @@ void AudioServerSW::init() { if (AudioDriverSW::get_singleton()) AudioDriverSW::get_singleton()->start(); -#ifndef NO_THREADS +#ifndef NO_AUDIO_THREADS exit_update_thread=false; thread = Thread::create(_thread_func,this); thread->set_name("AudioServerSW"); @@ -813,7 +817,7 @@ void AudioServerSW::init() { void AudioServerSW::finish() { -#ifndef NO_THREADS +#ifndef NO_AUDIO_THREADS exit_update_thread=true; Thread::wait_to_finish(thread); memdelete(thread); @@ -846,7 +850,7 @@ void AudioServerSW::_update_streams(bool p_thread) { void AudioServerSW::update() { _update_streams(false); -#ifdef NO_THREADS +#ifdef NO_AUDIO_THREADS _update_streams(true); #endif