Index: src/DefaultTimer.cpp |
diff --git a/src/DefaultTimer.cpp b/src/DefaultTimer.cpp |
index 597dec3effc0abc41fc9dc81dd473558287c799a..54fb39d9d8b57035371d3e5152a452991818435d 100644 |
--- a/src/DefaultTimer.cpp |
+++ b/src/DefaultTimer.cpp |
@@ -43,9 +43,11 @@ void DefaultTimer::SetTimer(const std::chrono::milliseconds& timeout, const Time |
{ |
if (!timerCallback) |
return; |
- std::lock_guard<std::mutex> lock(mutex); |
- TimerUnit timer = { std::chrono::steady_clock::now() + timeout, timerCallback }; |
- timers.push(timer); |
+ { |
+ std::lock_guard<std::mutex> lock(mutex); |
+ TimerUnit timer = { std::chrono::steady_clock::now() + timeout, timerCallback }; |
+ timers.push(timer); |
+ } |
conditionVariable.notify_one(); |
} |