diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-14 23:09:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 23:09:03 +0200 |
commit | 00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (patch) | |
tree | 2b1c31f45add24085b64425ce440f577424c16a1 /core/command_queue_mt.cpp | |
parent | 5046f666a1181675b39f156c38346525dc1c444e (diff) | |
parent | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (diff) |
Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
Diffstat (limited to 'core/command_queue_mt.cpp')
-rw-r--r-- | core/command_queue_mt.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp index 60ab5d133b..ace210ca2c 100644 --- a/core/command_queue_mt.cpp +++ b/core/command_queue_mt.cpp @@ -33,30 +33,24 @@ #include "core/os/os.h" void CommandQueueMT::lock() { - mutex.lock(); } void CommandQueueMT::unlock() { - mutex.unlock(); } void CommandQueueMT::wait_for_flush() { - // wait one millisecond for a flush to happen OS::get_singleton()->delay_usec(1000); } CommandQueueMT::SyncSemaphore *CommandQueueMT::_alloc_sync_sem() { - int idx = -1; while (true) { - lock(); for (int i = 0; i < SYNC_SEMAPHORES; i++) { - if (!sync_sems[i].in_use) { sync_sems[i].in_use = true; idx = i; @@ -100,12 +94,14 @@ tryagain: } CommandQueueMT::CommandQueueMT(bool p_sync) { - if (p_sync) + if (p_sync) { sync = memnew(Semaphore); + } } CommandQueueMT::~CommandQueueMT() { - if (sync) + if (sync) { memdelete(sync); + } memfree(command_mem); } |