From bd70b8e1f643dbf7252be9bc367e0de0f82d722d Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Fri, 1 Dec 2023 13:39:09 -0500 Subject: Add THREADS_ENABLED macro in order to compile Godot to run on the main thread --- core/os/condition_variable.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'core/os/condition_variable.h') diff --git a/core/os/condition_variable.h b/core/os/condition_variable.h index 6a49ced31b..2b6b272e18 100644 --- a/core/os/condition_variable.h +++ b/core/os/condition_variable.h @@ -33,6 +33,8 @@ #include "core/os/mutex.h" +#ifdef THREADS_ENABLED + #ifdef MINGW_ENABLED #define MINGW_STDTHREAD_REDUNDANCY_WARNING #include "thirdparty/mingw-std-threads/mingw.condition_variable.h" @@ -66,4 +68,16 @@ public: } }; +#else // No threads. + +class ConditionVariable { +public: + template + void wait(const MutexLock &p_lock) const {} + void notify_one() const {} + void notify_all() const {} +}; + +#endif // THREADS_ENABLED + #endif // CONDITION_VARIABLE_H -- cgit v1.2.3