17 #ifndef THRILL_COMMON_SHARED_STATE_HEADER 18 #define THRILL_COMMON_SHARED_STATE_HEADER 20 #include <condition_variable> 26 template <
typename ValueType =
size_t>
35 std::condition_variable
cv_;
51 std::unique_lock<std::mutex> lock(mutex_);
58 std::unique_lock<std::mutex> lock(mutex_);
59 while (needed_state != state_)
64 std::unique_lock<std::mutex> lock(mutex_);
72 #endif // !THRILL_COMMON_SHARED_STATE_HEADER
std::mutex mutex_
mutex for condition variable
SharedState(const value_type &s)
void set_to(const value_type &new_state)
void wait_for(const value_type &needed_state)
std::condition_variable cv_
condition variable
value_type state_
current state
SharedState & operator=(const SharedState &)=delete
non-copyable: delete assignment operator