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:
parent
8870f43d74
commit
8e128726f0
58 changed files with 650 additions and 639 deletions
|
|
@ -62,7 +62,7 @@ bool Reference::reference() {
|
|||
if (get_script_instance()) {
|
||||
get_script_instance()->refcount_incremented();
|
||||
}
|
||||
if (instance_binding_count > 0 && !ScriptServer::are_languages_finished()) {
|
||||
if (instance_binding_count.get() > 0 && !ScriptServer::are_languages_finished()) {
|
||||
for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
|
||||
if (_script_instance_bindings[i]) {
|
||||
ScriptServer::get_language(i)->refcount_incremented_instance_binding(this);
|
||||
|
|
@ -83,7 +83,7 @@ bool Reference::unreference() {
|
|||
bool script_ret = get_script_instance()->refcount_decremented();
|
||||
die = die && script_ret;
|
||||
}
|
||||
if (instance_binding_count > 0 && !ScriptServer::are_languages_finished()) {
|
||||
if (instance_binding_count.get() > 0 && !ScriptServer::are_languages_finished()) {
|
||||
for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
|
||||
if (_script_instance_bindings[i]) {
|
||||
bool script_ret = ScriptServer::get_language(i)->refcount_decremented_instance_binding(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue