X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/442a7c3376eb3a0bdde33e546a8146690c677466..24de4abff1dbfc7c779f6768186be603342df002:/include/simgrid/s4u/ConditionVariable.hpp diff --git a/include/simgrid/s4u/ConditionVariable.hpp b/include/simgrid/s4u/ConditionVariable.hpp index c087a0e5ef..1bd6e119eb 100644 --- a/include/simgrid/s4u/ConditionVariable.hpp +++ b/include/simgrid/s4u/ConditionVariable.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -30,18 +30,17 @@ namespace s4u { * semantic. But we currently use (only) double for both durations and * timestamp timeouts. */ -XBT_PUBLIC_CLASS ConditionVariable -{ +class XBT_PUBLIC ConditionVariable { private: - friend s_smx_cond; + friend s_smx_cond_t; smx_cond_t cond_; explicit ConditionVariable(smx_cond_t cond) : cond_(cond) {} public: ConditionVariable(ConditionVariable const&) = delete; ConditionVariable& operator=(ConditionVariable const&) = delete; - friend XBT_PUBLIC(void) intrusive_ptr_add_ref(ConditionVariable * cond); - friend XBT_PUBLIC(void) intrusive_ptr_release(ConditionVariable * cond); + friend XBT_PUBLIC void intrusive_ptr_add_ref(ConditionVariable * cond); + friend XBT_PUBLIC void intrusive_ptr_release(ConditionVariable * cond); using Ptr = boost::intrusive_ptr; static Ptr createConditionVariable(); @@ -52,7 +51,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 +61,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; @@ -103,9 +102,6 @@ public: void notify_one(); void notify_all(); - - XBT_ATTRIB_DEPRECATED("Use notify_one() instead") - void notify() { notify_one(); } }; using ConditionVariablePtr = ConditionVariable::Ptr;