aboutsummaryrefslogtreecommitdiff
path: root/support/Semaphore.h
diff options
context:
space:
mode:
Diffstat (limited to 'support/Semaphore.h')
-rw-r--r--support/Semaphore.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/support/Semaphore.h b/support/Semaphore.h
index 636d5caf79..85749e143d 100644
--- a/support/Semaphore.h
+++ b/support/Semaphore.h
@@ -46,8 +46,10 @@ public:
/** Signals a semaphore */
inline void signal()
{
- std::unique_lock<std::mutex> lock(_m);
- ++_value;
+ {
+ std::lock_guard<std::mutex> lock(_m);
+ ++_value;
+ }
_cv.notify_one();
}
/** Waits on a semaphore */