From 4351ea3098eac75b12cfabfba64790bd78bd9116 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 16 Dec 2024 09:00:45 -0500 Subject: [PATCH] apple: fix reinit of gcd task queue (#17262) --- libretro-common/queues/task_queue.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libretro-common/queues/task_queue.c b/libretro-common/queues/task_queue.c index 5eab7be447..35614770df 100644 --- a/libretro-common/queues/task_queue.c +++ b/libretro-common/queues/task_queue.c @@ -717,6 +717,8 @@ static void retro_task_gcd_wait(retro_task_condition_fn_t cond, void* data) static void retro_task_gcd_init(void) { + retro_task_t *task = NULL; + running_lock = slock_new(); finished_lock = slock_new(); property_lock = slock_new(); @@ -725,6 +727,12 @@ static void retro_task_gcd_init(void) slock_lock(running_lock); worker_continue = true; + for (task = tasks_running.front; task; task = task->next) + { + gcd_queue_count++; + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), + ^{ gcd_worker(task); }); + }; slock_unlock(running_lock); }