From 33d6d93ae20bd530aef6c192ff4609a04351230e Mon Sep 17 00:00:00 2001 From: Leonid Stryzhevskyi Date: Mon, 16 Jan 2023 00:20:09 +0200 Subject: [PATCH] Edit changelog/1.4.0.md --- changelog/1.4.0.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/changelog/1.4.0.md b/changelog/1.4.0.md index aad14b6c..6fdc91a7 100644 --- a/changelog/1.4.0.md +++ b/changelog/1.4.0.md @@ -7,6 +7,7 @@ Feel free to ask questions - [Chat on Gitter!](https://gitter.im/oatpp-framework Contents: - [URL Encoder And Decoder](#url-encoder-and-decoder) +- [Introduce async::ConditionVariable](#async-condition-variable) ## URL Encoder And Decoder @@ -25,3 +26,24 @@ auto decoded = oatpp::encoding::Url::decode(encoded); OATPP_ASSERT(decoded == data); ``` **Note**: Oat++ does NOT automatically decode URL and its parameters on endpoint hit. + +## Async Condition Variable + +```cpp +#include "oatpp/core/async/ConditionVariable.hpp" + + ... + + oatpp::async::Lock* m_lock; + oatpp::async::ConditionVariable* m_cv; + + ... + + Action act() override { + return m_cv->waitFor(m_lock, // async::Lock + [this]{return m_resource->counter == 100;}, // condition + std::chrono::seconds(5)) // timeout + .next(finish()); + } + ... +```