summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-12-21 10:26:04 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-12-21 10:26:04 -0300
commit3fe740dac6404c3e1dbbca887daddc59c8da549b (patch)
tree03c28b21507a1c801533079fd286d1c823bbc0eb /servers
parent49a19f85b8c49b891cdc2fdfaebce5e176c9b0c3 (diff)
parentd4ed0439680f7513d6a50be3aeb3a08875a4fb84 (diff)
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'servers')
-rw-r--r--servers/audio/audio_server_sw.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/servers/audio/audio_server_sw.cpp b/servers/audio/audio_server_sw.cpp
index 47e4ccbf32..a20e0e4ab5 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(); }
@@ -775,7 +779,7 @@ void AudioServerSW::_thread_func(void *self) {
AudioServerSW *as=(AudioServerSW *)self;
- as->thread->set_name("AudioServerSW");
+ //as->thread->set_name("AudioServerSW");
while (!as->exit_update_thread) {
as->_update_streams(true);
@@ -814,16 +818,17 @@ 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");
#endif
}
void AudioServerSW::finish() {
-#ifndef NO_THREADS
+#ifndef NO_AUDIO_THREADS
exit_update_thread=true;
Thread::wait_to_finish(thread);
memdelete(thread);
@@ -856,7 +861,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