1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Move wait_for_flush out of queue lock

This commit is contained in:
Sipaha
2017-08-21 01:10:44 +07:00
parent 541fdffc0a
commit f6ee4cac39
2 changed files with 47 additions and 18 deletions

View File

@@ -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();