X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/43388fb03f79aae5ddd0572c0081cfbe1cf22670..e595b191c3e10a96a9d896f6ecec9c4df6707aef:/include/simgrid/s4u/ConditionVariable.hpp diff --git a/include/simgrid/s4u/ConditionVariable.hpp b/include/simgrid/s4u/ConditionVariable.hpp index 2ccf89d5e9..5af34467d6 100644 --- a/include/simgrid/s4u/ConditionVariable.hpp +++ b/include/simgrid/s4u/ConditionVariable.hpp @@ -35,7 +35,7 @@ XBT_PUBLIC_CLASS ConditionVariable private: friend s_smx_cond; smx_cond_t cond_; - ConditionVariable(smx_cond_t cond) : cond_(cond) {} + explicit ConditionVariable(smx_cond_t cond) : cond_(cond) {} public: ConditionVariable(ConditionVariable const&) = delete; ConditionVariable& operator=(ConditionVariable const&) = delete; @@ -52,7 +52,7 @@ public: void wait(std::unique_lock & lock); template void wait(std::unique_lock & lock, P pred) { - while (!pred()) + while (not pred()) wait(lock); } @@ -62,7 +62,7 @@ public: std::cv_status wait_for(std::unique_lock & lock, double duration); template bool wait_until(std::unique_lock & lock, double timeout_time, P pred) { - while (!pred()) + while (not pred()) if (this->wait_until(lock, timeout_time) == std::cv_status::timeout) return pred(); return true; @@ -104,8 +104,10 @@ public: void notify_one(); void notify_all(); - XBT_ATTRIB_DEPRECATED("Use notify_one() instead") - void notify() { notify_one(); } + XBT_ATTRIB_DEPRECATED_v319("Use notify_one(): v3.19 will change this warning into an error.") void notify() + { + notify_one(); + } }; using ConditionVariablePtr = ConditionVariable::Ptr;