mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add THREADS_ENABLED macro in order to compile Godot to run on the main thread
This commit is contained in:
@@ -31,6 +31,10 @@
|
||||
#ifndef SEMAPHORE_H
|
||||
#define SEMAPHORE_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef THREADS_ENABLED
|
||||
|
||||
#include "core/error/error_list.h"
|
||||
#include "core/typedefs.h"
|
||||
#ifdef DEBUG_ENABLED
|
||||
@@ -132,4 +136,17 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
#else // No threads.
|
||||
|
||||
class Semaphore {
|
||||
public:
|
||||
void post(uint32_t p_count = 1) const {}
|
||||
void wait() const {}
|
||||
bool try_wait() const {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // THREADS_ENABLED
|
||||
|
||||
#endif // SEMAPHORE_H
|
||||
|
||||
Reference in New Issue
Block a user