MCPcopy Create free account
hub / github.com/defold/defold / SoundThread

Function SoundThread

engine/sound/src/sound_openal.cpp:428–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426 }
427
428 static void SoundThread(void* _args)
429 {
430 ThreadArgs* args = (ThreadArgs*)_args;
431 SoundSystem* sound = args->m_Sound;
432
433 dmMutex::Lock(sound->m_Mutex);
434 Result result = InitializeInternal(sound, args);
435 if (result == RESULT_OK)
436 {
437 dmAtomicStore32(&sound->m_Status, (int)result);
438
439 dmConditionVariable::Signal(sound->m_CondVar);
440 dmMutex::Unlock(sound->m_Mutex);
441
442 emscripten_set_main_loop_arg(SoundThreadEmscriptenCallback, sound, 1000 / 16, 1); // roughly '60fps'
443
444 dmMutex::Lock(sound->m_Mutex);
445 result = sound->FinalizeOpenal();
446 }
447
448 dmAtomicStore32(&sound->m_Status, (int)result);
449 dmConditionVariable::Signal(sound->m_CondVar);
450 dmMutex::Unlock(sound->m_Mutex);
451 }
452 #endif
453
454 Result Initialize(dmConfigFile::HConfig config, const InitializeParams* params)

Callers

nothing calls this directly

Calls 6

InitializeInternalFunction · 0.85
dmAtomicStore32Function · 0.85
FinalizeOpenalMethod · 0.80
LockFunction · 0.50
SignalFunction · 0.50
UnlockFunction · 0.50

Tested by

no test coverage detected