summaryrefslogtreecommitdiffstats
path: root/core/os/semaphore.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/semaphore.h')
-rw-r--r--core/os/semaphore.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/os/semaphore.h b/core/os/semaphore.h
index b8ae35b86b..19ef1dedc0 100644
--- a/core/os/semaphore.h
+++ b/core/os/semaphore.h
@@ -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