summaryrefslogtreecommitdiffstats
path: root/core/templates/command_queue_mt.cpp
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2024-07-18 14:54:58 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2024-09-05 13:29:38 +0200
commitc75c50ecac2967217966762d492c4d9d268e51a3 (patch)
tree5ea79479145b869278d9072d0bce76fe5fc75e0f /core/templates/command_queue_mt.cpp
parentb3e46a913d10b029b8ebeb58017e1ce260c42988 (diff)
downloadredot-engine-c75c50ecac2967217966762d492c4d9d268e51a3.tar.gz
WorkerThreadPool (plus friends): Overhaul unlock allowance zones
This fixes a rare but possible deadlock, maybe due to undefined behavior. The new implementation is safer, at the cost of some added boilerplate. (cherry picked from commit f4d76853b9d921e3645295f9bebc39eb73661e67)
Diffstat (limited to 'core/templates/command_queue_mt.cpp')
-rw-r--r--core/templates/command_queue_mt.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/core/templates/command_queue_mt.cpp b/core/templates/command_queue_mt.cpp
index ef75a70868..5fa767263f 100644
--- a/core/templates/command_queue_mt.cpp
+++ b/core/templates/command_queue_mt.cpp
@@ -33,14 +33,6 @@
#include "core/config/project_settings.h"
#include "core/os/os.h"
-void CommandQueueMT::lock() {
- mutex.lock();
-}
-
-void CommandQueueMT::unlock() {
- mutex.unlock();
-}
-
CommandQueueMT::CommandQueueMT() {
command_mem.reserve(DEFAULT_COMMAND_MEM_SIZE_KB * 1024);
}