mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(Threaded Tasks) Fix race condition at task_queue_wait (#13898)
This commit is contained in:
parent
984f857621
commit
7a70b36c8b
@ -423,6 +423,13 @@ static void retro_task_threaded_wait(retro_task_condition_fn_t cond, void* data)
|
||||
slock_lock(running_lock);
|
||||
wait = (tasks_running.front && !tasks_running.front->when);
|
||||
slock_unlock(running_lock);
|
||||
|
||||
if (!wait)
|
||||
{
|
||||
slock_lock(finished_lock);
|
||||
wait = (tasks_finished.front && !tasks_finished.front->when);
|
||||
slock_unlock(finished_lock);
|
||||
}
|
||||
} while (wait && (!cond || cond(data)));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user