mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Modernize RWLock
- Based on C++14's `shared_time_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`
This commit is contained in:
@@ -929,9 +929,9 @@ void ClassDB::add_property_group(StringName p_class, const String &p_name, const
|
||||
|
||||
void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, const StringName &p_setter, const StringName &p_getter, int p_index) {
|
||||
|
||||
lock->read_lock();
|
||||
lock.read_lock();
|
||||
ClassInfo *type = classes.getptr(p_class);
|
||||
lock->read_unlock();
|
||||
lock.read_unlock();
|
||||
|
||||
ERR_FAIL_COND(!type);
|
||||
|
||||
@@ -1447,12 +1447,7 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con
|
||||
return default_values[p_class][p_property];
|
||||
}
|
||||
|
||||
RWLock *ClassDB::lock = NULL;
|
||||
|
||||
void ClassDB::init() {
|
||||
|
||||
lock = RWLock::create();
|
||||
}
|
||||
RWLock ClassDB::lock;
|
||||
|
||||
void ClassDB::cleanup_defaults() {
|
||||
|
||||
@@ -1479,8 +1474,6 @@ void ClassDB::cleanup() {
|
||||
classes.clear();
|
||||
resource_base_extensions.clear();
|
||||
compat_classes.clear();
|
||||
|
||||
memdelete(lock);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user