Add support for running custom code on thread entry and exit.

To use this, define `MA_ON_THREAD_ENTRY` and `MA_ON_THREAD_EXIT` before
the implementation of miniaudio.

Public issue https://github.com/mackron/miniaudio/issues/301
This commit is contained in:
David Reid
2021-05-14 18:09:49 +10:00
parent 2eb792b719
commit c6b44df8f4
2 changed files with 59 additions and 7 deletions
+1 -1
View File
@@ -5947,7 +5947,7 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon
/* Create the job threads last to ensure the threads has access to valid data. */
for (iJobThread = 0; iJobThread < pResourceManager->config.jobThreadCount; iJobThread += 1) {
result = ma_thread_create(&pResourceManager->jobThreads[iJobThread], ma_thread_priority_normal, 0, ma_resource_manager_job_thread, pResourceManager);
result = ma_thread_create(&pResourceManager->jobThreads[iJobThread], ma_thread_priority_normal, 0, ma_resource_manager_job_thread, &pResourceManager->config.allocationCallbacks);
if (result != MA_SUCCESS) {
ma_mutex_uninit(&pResourceManager->dataBufferBSTLock);
ma_job_queue_uninit(&pResourceManager->jobQueue);