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.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/os/semaphore.h b/core/os/semaphore.h
index 8bb1529bbd..b8ae35b86b 100644
--- a/core/os/semaphore.h
+++ b/core/os/semaphore.h
@@ -58,10 +58,12 @@ private:
#endif
public:
- _ALWAYS_INLINE_ void post() const {
+ _ALWAYS_INLINE_ void post(uint32_t p_count = 1) const {
std::lock_guard lock(mutex);
- count++;
- condition.notify_one();
+ count += p_count;
+ for (uint32_t i = 0; i < p_count; ++i) {
+ condition.notify_one();
+ }
}
_ALWAYS_INLINE_ void wait() const {