mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
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 f4d76853b9)
This commit is contained in:
parent
b3e46a913d
commit
c75c50ecac
12 changed files with 118 additions and 110 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue