mirror of
https://github.com/BlackMATov/promise.hpp.git
synced 2025-12-16 14:11:21 +07:00
add wait noexcepts
This commit is contained in:
@@ -545,7 +545,7 @@ namespace promise_hpp
|
|||||||
return state_->get();
|
return state_->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait() const {
|
void wait() const noexcept {
|
||||||
state_->wait();
|
state_->wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,7 +607,7 @@ namespace promise_hpp
|
|||||||
return storage_.value();
|
return storage_.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait() const {
|
void wait() const noexcept {
|
||||||
std::unique_lock<std::mutex> lock(mutex_);
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
cond_var_.wait(lock, [this](){
|
cond_var_.wait(lock, [this](){
|
||||||
return status_ != status::pending;
|
return status_ != status::pending;
|
||||||
@@ -934,7 +934,7 @@ namespace promise_hpp
|
|||||||
state_->get();
|
state_->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait() const {
|
void wait() const noexcept {
|
||||||
state_->wait();
|
state_->wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,7 +993,7 @@ namespace promise_hpp
|
|||||||
assert(status_ == status::resolved);
|
assert(status_ == status::resolved);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait() const {
|
void wait() const noexcept {
|
||||||
std::unique_lock<std::mutex> lock(mutex_);
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
cond_var_.wait(lock, [this](){
|
cond_var_.wait(lock, [this](){
|
||||||
return status_ != status::pending;
|
return status_ != status::pending;
|
||||||
|
|||||||
Reference in New Issue
Block a user