X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4bb73cb3914b5f7b77a9ec1f8abe728e637cc016..a769d0bfd8cf7d4e8f9ae4dfbcf69d8a851508da:/include/simgrid/s4u/ConditionVariable.hpp diff --git a/include/simgrid/s4u/ConditionVariable.hpp b/include/simgrid/s4u/ConditionVariable.hpp index 5efc7f9bc8..6e6ec3122b 100644 --- a/include/simgrid/s4u/ConditionVariable.hpp +++ b/include/simgrid/s4u/ConditionVariable.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2019. 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. */ @@ -6,19 +6,10 @@ #ifndef SIMGRID_S4U_COND_VARIABLE_HPP #define SIMGRID_S4U_COND_VARIABLE_HPP -#include -#include -#include -#include -#include // std::swap - -#include - -#include - #include #include -#include + +#include namespace simgrid { namespace s4u { @@ -30,21 +21,30 @@ 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_t; - smx_cond_t cond_; - explicit ConditionVariable(smx_cond_t cond) : cond_(cond) {} + friend kernel::activity::ConditionVariableImpl; + kernel::activity::ConditionVariableImpl* const cond_; + + explicit ConditionVariable(kernel::activity::ConditionVariableImpl* 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); - using Ptr = boost::intrusive_ptr; - static Ptr createConditionVariable(); + static ConditionVariablePtr create(); + +#ifndef DOXYGEN + /** @deprecated See Comm::get_mailbox() */ + XBT_ATTRIB_DEPRECATED_v323("Please use ConditionVariableImpl::create()") ConditionVariablePtr + createConditionVariable() + { + return create(); + } +#endif // Wait functions without time: @@ -105,8 +105,7 @@ public: void notify_all(); }; -using ConditionVariablePtr = ConditionVariable::Ptr; -} -} // namespace simgrid::s4u +} // namespace s4u +} // namespace simgrid #endif