You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Modernize Mutex
- Based on C++11's `mutex` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed - Simpler for `NO_THREADS` - `BinaryMutex` added for special cases as the non-recursive version - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
This commit is contained in:
@@ -121,9 +121,7 @@ class NativeScript : public Script {
|
||||
String script_class_name;
|
||||
String script_class_icon_path;
|
||||
|
||||
#ifndef NO_THREADS
|
||||
Mutex *owners_lock;
|
||||
#endif
|
||||
Mutex owners_lock;
|
||||
Set<Object *> instance_owners;
|
||||
|
||||
protected:
|
||||
@@ -238,7 +236,7 @@ private:
|
||||
void _unload_stuff(bool p_reload = false);
|
||||
|
||||
#ifndef NO_THREADS
|
||||
Mutex *mutex;
|
||||
Mutex mutex;
|
||||
|
||||
Set<Ref<GDNativeLibrary> > libs_to_init;
|
||||
Set<NativeScript *> scripts_to_register;
|
||||
|
||||
Reference in New Issue
Block a user