You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Modernize atomics
- Based on C++11's `atomic` - Reworked `SafeRefCount` (based on the rewrite by @hpvb) - Replaced free atomic functions by the new `SafeNumeric<T>` - Replaced wrong cases of `volatile bool` by the new `SafeFlag` - Platform-specific implementations no longer needed Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
This commit is contained in:
@@ -1670,7 +1670,7 @@ void NativeScriptLanguage::defer_init_library(Ref<GDNativeLibrary> lib, NativeSc
|
||||
MutexLock lock(mutex);
|
||||
libs_to_init.insert(lib);
|
||||
scripts_to_register.insert(script);
|
||||
has_objects_to_register = true;
|
||||
has_objects_to_register.set();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1759,7 +1759,7 @@ void NativeScriptLanguage::call_libraries_cb(const StringName &name) {
|
||||
|
||||
void NativeScriptLanguage::frame() {
|
||||
#ifndef NO_THREADS
|
||||
if (has_objects_to_register) {
|
||||
if (has_objects_to_register.is_set()) {
|
||||
MutexLock lock(mutex);
|
||||
for (Set<Ref<GDNativeLibrary>>::Element *L = libs_to_init.front(); L; L = L->next()) {
|
||||
init_library(L->get());
|
||||
@@ -1769,7 +1769,7 @@ void NativeScriptLanguage::frame() {
|
||||
register_script(S->get());
|
||||
}
|
||||
scripts_to_register.clear();
|
||||
has_objects_to_register = false;
|
||||
has_objects_to_register.clear();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user