You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10: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:
@@ -34,7 +34,7 @@
|
||||
#include "gdscript.h"
|
||||
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/os/mutex.h"
|
||||
#include "core/os/safe_binary_mutex.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "core/templates/hash_set.h"
|
||||
|
||||
@@ -95,7 +95,12 @@ class GDScriptCache {
|
||||
|
||||
bool cleared = false;
|
||||
|
||||
Mutex mutex;
|
||||
public:
|
||||
static const int BINARY_MUTEX_TAG = 2;
|
||||
|
||||
private:
|
||||
static SafeBinaryMutex<BINARY_MUTEX_TAG> mutex;
|
||||
friend SafeBinaryMutex<BINARY_MUTEX_TAG> &_get_gdscript_cache_mutex();
|
||||
|
||||
public:
|
||||
static void move_script(const String &p_from, const String &p_to);
|
||||
|
||||
Reference in New Issue
Block a user