diff options
| author | Rémi Verschelde | 2017-08-21 22:55:07 +0200 |
|---|---|---|
| committer | GitHub | 2017-08-21 22:55:07 +0200 |
| commit | de261ef3806bd2b61cbb2e46ef92db0897ec73cf (patch) | |
| tree | 6baa73e1053987e15b6aa90ca61053b72ccfab17 /core/command_queue_mt.cpp | |
| parent | bb41e1427e5a0f88f8752d46425b778163868fe5 (diff) | |
| parent | f6ee4cac39fa83a1691f102760b7f008403acdc2 (diff) | |
| download | godot-de261ef3806bd2b61cbb2e46ef92db0897ec73cf.tar.gz godot-de261ef3806bd2b61cbb2e46ef92db0897ec73cf.tar.zst godot-de261ef3806bd2b61cbb2e46ef92db0897ec73cf.zip | |
Merge pull request #10484 from Sipaha/pr_mt_queue_deadlock_fix
Fix deadlock in CommandQueueMT
Diffstat (limited to 'core/command_queue_mt.cpp')
| -rw-r--r-- | core/command_queue_mt.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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(); |
