1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +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` 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:
Pedro J. Estébanez
2021-01-31 13:34:42 +01:00
parent 6d89f675b1
commit 4485b43a57
54 changed files with 641 additions and 676 deletions

View File

@@ -1276,10 +1276,10 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui
}
void VisualShader::_update_shader() const {
if (!dirty)
if (!dirty.is_set())
return;
dirty = false;
dirty.clear();
StringBuilder global_code;
StringBuilder global_code_per_node;
@@ -1439,11 +1439,11 @@ void VisualShader::_update_shader() const {
}
void VisualShader::_queue_update() {
if (dirty) {
if (dirty.is_set()) {
return;
}
dirty = true;
dirty.set();
call_deferred("_update_shader");
}
@@ -1463,7 +1463,7 @@ void VisualShader::_input_type_changed(Type p_type, int p_id) {
}
void VisualShader::rebuild() {
dirty = true;
dirty.set();
_update_shader();
}
@@ -1524,7 +1524,7 @@ VisualShader::VisualShader() {
graph[i].nodes[NODE_ID_OUTPUT].position = Vector2(400, 150);
}
dirty = true;
dirty.set();
}
///////////////////////////////////////////////////////////