From f6ee4cac39fa83a1691f102760b7f008403acdc2 Mon Sep 17 00:00:00 2001 From: Sipaha Date: Mon, 21 Aug 2017 01:10:44 +0700 Subject: Move wait_for_flush out of queue lock --- core/command_queue_mt.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/command_queue_mt.cpp') diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp index 823494ff6..c9edd1d47 100644 --- a/core/command_queue_mt.cpp +++ b/core/command_queue_mt.cpp @@ -55,6 +55,7 @@ CommandQueueMT::SyncSemaphore *CommandQueueMT::_alloc_sync_sem() { while (true) { + lock(); for (int i = 0; i < SYNC_SEMAPHORES; i++) { if (!sync_sems[i].in_use) { @@ -63,6 +64,7 @@ CommandQueueMT::SyncSemaphore *CommandQueueMT::_alloc_sync_sem() { break; } } + unlock(); if (idx == -1) { wait_for_flush(); -- cgit v1.2.3-70-g09d2