You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20: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` 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:
@@ -34,6 +34,7 @@
|
||||
#include "core/io/http_client.h"
|
||||
#include "core/os/file_access.h"
|
||||
#include "core/os/thread.h"
|
||||
#include "core/safe_refcount.h"
|
||||
#include "node.h"
|
||||
#include "scene/main/timer.h"
|
||||
|
||||
@@ -74,7 +75,7 @@ private:
|
||||
bool request_sent;
|
||||
Ref<HTTPClient> client;
|
||||
PoolByteArray body;
|
||||
volatile bool use_threads;
|
||||
SafeFlag use_threads;
|
||||
|
||||
bool got_response;
|
||||
int response_code;
|
||||
@@ -85,7 +86,7 @@ private:
|
||||
FileAccess *file;
|
||||
|
||||
int body_len;
|
||||
volatile int downloaded;
|
||||
SafeNumeric<int> downloaded;
|
||||
int body_size_limit;
|
||||
|
||||
int redirections;
|
||||
@@ -103,8 +104,8 @@ private:
|
||||
Error _parse_url(const String &p_url);
|
||||
Error _request();
|
||||
|
||||
volatile bool thread_done;
|
||||
volatile bool thread_request_quit;
|
||||
SafeFlag thread_done;
|
||||
SafeFlag thread_request_quit;
|
||||
|
||||
Thread thread;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user