diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-03 14:51:02 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-03 14:51:02 +0200 |
commit | d598fff7c24ef675e7bbb794f7abe80d1d24220b (patch) | |
tree | 562767284470e5424dc9ebed394a1c400895900b /core/os/thread.h | |
parent | 5b47bb8446afbbbf9d6eeec81008d5b430b59706 (diff) | |
parent | 54418ea659061edccdf1ac16470505542dcc33f9 (diff) |
Merge pull request #66803 from akien-mga/core-remove-NO_THREADS
Remove `NO_THREADS` fallback code, Godot 4 requires thread support
Diffstat (limited to 'core/os/thread.h')
-rw-r--r-- | core/os/thread.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/core/os/thread.h b/core/os/thread.h index 0fb283e224..7462ec17fb 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -35,15 +35,14 @@ #ifdef PLATFORM_THREAD_OVERRIDE #include "platform_thread.h" #else + #ifndef THREAD_H #define THREAD_H +#include "core/templates/safe_refcount.h" #include "core/typedefs.h" -#if !defined(NO_THREADS) -#include "core/templates/safe_refcount.h" #include <thread> -#endif class String; @@ -65,7 +64,6 @@ public: }; private: -#if !defined(NO_THREADS) friend class Main; static ID main_thread_id; @@ -82,7 +80,6 @@ private: static void (*set_priority_func)(Thread::Priority); static void (*init_func)(); static void (*term_func)(); -#endif public: static void _set_platform_funcs( @@ -91,7 +88,6 @@ public: void (*p_init_func)() = nullptr, void (*p_term_func)() = nullptr); -#if !defined(NO_THREADS) _FORCE_INLINE_ ID get_id() const { return id; } // get the ID of the caller thread _FORCE_INLINE_ static ID get_caller_id() { return caller_id; } @@ -107,19 +103,6 @@ public: Thread(); ~Thread(); -#else - _FORCE_INLINE_ ID get_id() const { return 0; } - // get the ID of the caller thread - _FORCE_INLINE_ static ID get_caller_id() { return 0; } - // get the ID of the main thread - _FORCE_INLINE_ static ID get_main_id() { return 0; } - - static Error set_name(const String &p_name) { return ERR_UNAVAILABLE; } - - void start(Thread::Callback p_callback, void *p_user, const Settings &p_settings = Settings()) {} - bool is_started() const { return false; } - void wait_to_finish() {} -#endif }; #endif // THREAD_H |