1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +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

@@ -5742,7 +5742,7 @@ static void _execute_thread(void *p_ud) {
eta->exitcode = err;
}
eta->done = true;
eta->done.set();
}
int EditorNode::execute_and_show_output(const String &p_title, const String &p_path, const List<String> &p_arguments, bool p_close_on_ok, bool p_close_on_errors) {
@@ -5757,13 +5757,12 @@ int EditorNode::execute_and_show_output(const String &p_title, const String &p_p
eta.path = p_path;
eta.args = p_arguments;
eta.exitcode = 255;
eta.done = false;
int prev_len = 0;
eta.execute_output_thread.start(_execute_thread, &eta);
while (!eta.done) {
while (!eta.done.is_set()) {
eta.execute_output_mutex.lock();
if (prev_len != eta.output.length()) {
String to_add = eta.output.substr(prev_len, eta.output.length());