diff options
author | Wilson E. Alvarez <wilson.e.alvarez@rubonnek.com> | 2024-02-09 14:35:32 -0500 |
---|---|---|
committer | Wilson E. Alvarez <wilson.e.alvarez@rubonnek.com> | 2024-02-09 14:37:17 -0500 |
commit | c32e48890f416b347fb26d8045c795a0bcabb03b (patch) | |
tree | 4ab8b50644325a767af40cb8d96bcad17a30c915 /platform/web | |
parent | 4e990cd7e51d17cf24f854cc33b2715eaa27200f (diff) | |
download | redot-engine-c32e48890f416b347fb26d8045c795a0bcabb03b.tar.gz |
Use SafeFlag for EditorHTTPServer.server_quit
Diffstat (limited to 'platform/web')
-rw-r--r-- | platform/web/export/editor_http_server.cpp | 6 | ||||
-rw-r--r-- | platform/web/export/editor_http_server.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/platform/web/export/editor_http_server.cpp b/platform/web/export/editor_http_server.cpp index 0ccd4b8782..9cf862eb1e 100644 --- a/platform/web/export/editor_http_server.cpp +++ b/platform/web/export/editor_http_server.cpp @@ -32,7 +32,7 @@ void EditorHTTPServer::_server_thread_poll(void *data) { EditorHTTPServer *web_server = static_cast<EditorHTTPServer *>(data); - while (!web_server->server_quit.get()) { + while (!web_server->server_quit.is_set()) { OS::get_singleton()->delay_usec(6900); { MutexLock lock(web_server->server_lock); @@ -193,7 +193,7 @@ void EditorHTTPServer::_poll() { } void EditorHTTPServer::stop() { - server_quit.set(true); + server_quit.set(); if (server_thread.is_started()) { server_thread.wait_to_finish(); } @@ -227,7 +227,7 @@ Error EditorHTTPServer::listen(int p_port, IPAddress p_address, bool p_use_tls, } Error err = server->listen(p_port, p_address); if (err == OK) { - server_quit.set(false); + server_quit.clear(); server_thread.start(_server_thread_poll, this); } return err; diff --git a/platform/web/export/editor_http_server.h b/platform/web/export/editor_http_server.h index 8f5f69cc1e..4437492b5a 100644 --- a/platform/web/export/editor_http_server.h +++ b/platform/web/export/editor_http_server.h @@ -51,7 +51,7 @@ private: uint8_t req_buf[4096]; int req_pos = 0; - SafeNumeric<bool> server_quit; + SafeFlag server_quit; Mutex server_lock; Thread server_thread; |