diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-28 00:26:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 00:26:01 +0100 |
commit | b7b39786840a41a057f531ed13b64e26366befac (patch) | |
tree | b78a2e0bc0b3f49e82e148e8edb741930ff0ce55 /core/command_queue_mt.cpp | |
parent | e66d519286693a03bf59eaba0a5f29c1c9b15d64 (diff) | |
parent | 18fbdbb456c07a56b358bea2e392765fbcbb3283 (diff) | |
download | redot-engine-b7b39786840a41a057f531ed13b64e26366befac.tar.gz |
Merge pull request #36556 from RandomShaper/rework_mutex
Reimplement `Mutex` with C++'s `<mutex>` (plus more)
Diffstat (limited to 'core/command_queue_mt.cpp')
-rw-r--r-- | core/command_queue_mt.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp index 861ca8d1d3..b88f773ed8 100644 --- a/core/command_queue_mt.cpp +++ b/core/command_queue_mt.cpp @@ -34,14 +34,12 @@ void CommandQueueMT::lock() { - if (mutex) - mutex->lock(); + mutex.lock(); } void CommandQueueMT::unlock() { - if (mutex) - mutex->unlock(); + mutex.unlock(); } void CommandQueueMT::wait_for_flush() { @@ -106,7 +104,6 @@ CommandQueueMT::CommandQueueMT(bool p_sync) { read_ptr = 0; write_ptr = 0; dealloc_ptr = 0; - mutex = Mutex::create(); command_mem = (uint8_t *)memalloc(COMMAND_MEM_SIZE); for (int i = 0; i < SYNC_SEMAPHORES; i++) { @@ -124,7 +121,6 @@ CommandQueueMT::~CommandQueueMT() { if (sync) memdelete(sync); - memdelete(mutex); for (int i = 0; i < SYNC_SEMAPHORES; i++) { memdelete(sync_sems[i].sem); |