From 54418ea659061edccdf1ac16470505542dcc33f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 3 Oct 2022 10:57:36 +0200 Subject: Remove NO_THREADS fallback code, Godot 4 requires thread support This also removes `OS::can_use_threads` from the public API since it's always true. --- core/debugger/remote_debugger_peer.cpp | 8 +------- core/debugger/remote_debugger_peer.h | 8 ++++---- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'core/debugger') diff --git a/core/debugger/remote_debugger_peer.cpp b/core/debugger/remote_debugger_peer.cpp index e9362b4ea4..525362ec7c 100644 --- a/core/debugger/remote_debugger_peer.cpp +++ b/core/debugger/remote_debugger_peer.cpp @@ -79,10 +79,8 @@ RemoteDebuggerPeerTCP::RemoteDebuggerPeerTCP(Ref p_tcp) { tcp_client = p_tcp; if (tcp_client.is_valid()) { // Attaching to an already connected stream. connected = true; -#ifndef NO_THREADS running = true; thread.start(_thread_func, this); -#endif } else { tcp_client.instantiate(); } @@ -183,10 +181,8 @@ Error RemoteDebuggerPeerTCP::connect_to_host(const String &p_host, uint16_t p_po return FAILED; } connected = true; -#ifndef NO_THREADS running = true; thread.start(_thread_func, this); -#endif return OK; } @@ -208,9 +204,7 @@ void RemoteDebuggerPeerTCP::_thread_func(void *p_ud) { } void RemoteDebuggerPeerTCP::poll() { -#ifdef NO_THREADS - _poll(); -#endif + // Nothing to do, polling is done in thread. } void RemoteDebuggerPeerTCP::_poll() { diff --git a/core/debugger/remote_debugger_peer.h b/core/debugger/remote_debugger_peer.h index 473fd8d712..2ab641d537 100644 --- a/core/debugger/remote_debugger_peer.h +++ b/core/debugger/remote_debugger_peer.h @@ -43,12 +43,12 @@ protected: public: virtual bool is_peer_connected() = 0; + virtual int get_max_message_size() const = 0; virtual bool has_message() = 0; virtual Error put_message(const Array &p_arr) = 0; virtual Array get_message() = 0; virtual void close() = 0; virtual void poll() = 0; - virtual int get_max_message_size() const = 0; virtual bool can_block() const { return true; } // If blocking io is allowed on main thread (debug). RemoteDebuggerPeer(); @@ -81,12 +81,12 @@ public: Error connect_to_host(const String &p_host, uint16_t p_port); - void poll() override; bool is_peer_connected() override; + int get_max_message_size() const override; bool has_message() override; - Array get_message() override; Error put_message(const Array &p_arr) override; - int get_max_message_size() const override; + Array get_message() override; + void poll() override; void close() override; RemoteDebuggerPeerTCP(Ref p_stream = Ref()); -- cgit v1.2.3