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.
This commit is contained in:
Pedro J. Estébanez 2024-07-18 14:54:58 +02:00
parent df23858488
commit f4d76853b9
12 changed files with 118 additions and 110 deletions

View file

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