Add THREADS_ENABLED macro in order to compile Godot to run on the main thread

This commit is contained in:
Adam Scott
2023-12-01 13:39:09 -05:00
parent 107f2961cc
commit bd70b8e1f6
33 changed files with 447 additions and 72 deletions

View File

@ -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 <class BinaryMutexT>
void wait(const MutexLock<BinaryMutexT> &p_lock) const {}
void notify_one() const {}
void notify_all() const {}
};
#endif // THREADS_ENABLED
#endif // CONDITION_VARIABLE_H