23 #include <condition_variable>
26 #include <olp/core/client/CancellationContext.h>
44 std::unique_lock<std::mutex> lock(mutex_);
50 condition_.notify_one();
62 bool Wait(std::chrono::milliseconds timeout = std::chrono::seconds(60)) {
63 std::unique_lock<std::mutex> lock(mutex_);
65 condition_.wait_for(lock, timeout, [&] {
return signaled_; });
72 std::condition_variable condition_;
74 bool signaled_{
false};
A helper class that allows one thread to call and wait for a notification in the other thread.
Definition: Condition.h:35
bool Wait(std::chrono::milliseconds timeout=std::chrono::seconds(60))
Waits for the Notify function.
Definition: Condition.h:62
void Notify()
Called by the task callback to notify Wait to unblock the routine.
Definition: Condition.h:43
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24