Added timeout to ConditionVariableNotifier::waitForNotification() function

This commit is contained in:
Nav
2022-04-15 23:30:57 +01:00
parent bd6a5d5051
commit a8c78dc86a
2 changed files with 14 additions and 5 deletions

View File

@@ -2,6 +2,8 @@
#include <mutex>
#include <condition_variable>
#include <chrono>
#include <optional>
#include "NotifierInterface.hpp"
@@ -34,7 +36,7 @@ namespace Bloom
/**
* Blocks until the contained std::conditional_variable is notified.
*/
void waitForNotification();
void waitForNotification(std::optional<std::chrono::milliseconds> timeout = std::nullopt);
private:
std::mutex mutex;