Merge branch 'master' of https://github.com/godotengine/godot
This commit is contained in:
commit
3fe740dac6
|
@ -30,6 +30,10 @@
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "os/os.h"
|
#include "os/os.h"
|
||||||
|
|
||||||
|
#ifdef NO_THREADS
|
||||||
|
#define NO_AUDIO_THREADS
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _AudioDriverLock {
|
struct _AudioDriverLock {
|
||||||
|
|
||||||
_AudioDriverLock() { if (AudioDriverSW::get_singleton()) AudioDriverSW::get_singleton()->lock(); }
|
_AudioDriverLock() { if (AudioDriverSW::get_singleton()) AudioDriverSW::get_singleton()->lock(); }
|
||||||
|
@ -775,7 +779,7 @@ void AudioServerSW::_thread_func(void *self) {
|
||||||
|
|
||||||
AudioServerSW *as=(AudioServerSW *)self;
|
AudioServerSW *as=(AudioServerSW *)self;
|
||||||
|
|
||||||
as->thread->set_name("AudioServerSW");
|
//as->thread->set_name("AudioServerSW");
|
||||||
|
|
||||||
while (!as->exit_update_thread) {
|
while (!as->exit_update_thread) {
|
||||||
as->_update_streams(true);
|
as->_update_streams(true);
|
||||||
|
@ -814,16 +818,17 @@ void AudioServerSW::init() {
|
||||||
if (AudioDriverSW::get_singleton())
|
if (AudioDriverSW::get_singleton())
|
||||||
AudioDriverSW::get_singleton()->start();
|
AudioDriverSW::get_singleton()->start();
|
||||||
|
|
||||||
#ifndef NO_THREADS
|
#ifndef NO_AUDIO_THREADS
|
||||||
exit_update_thread=false;
|
exit_update_thread=false;
|
||||||
thread = Thread::create(_thread_func,this);
|
thread = Thread::create(_thread_func,this);
|
||||||
|
thread->set_name("AudioServerSW");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioServerSW::finish() {
|
void AudioServerSW::finish() {
|
||||||
|
|
||||||
#ifndef NO_THREADS
|
#ifndef NO_AUDIO_THREADS
|
||||||
exit_update_thread=true;
|
exit_update_thread=true;
|
||||||
Thread::wait_to_finish(thread);
|
Thread::wait_to_finish(thread);
|
||||||
memdelete(thread);
|
memdelete(thread);
|
||||||
|
@ -856,7 +861,7 @@ void AudioServerSW::_update_streams(bool p_thread) {
|
||||||
void AudioServerSW::update() {
|
void AudioServerSW::update() {
|
||||||
|
|
||||||
_update_streams(false);
|
_update_streams(false);
|
||||||
#ifdef NO_THREADS
|
#ifdef NO_AUDIO_THREADS
|
||||||
|
|
||||||
_update_streams(true);
|
_update_streams(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue