Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
untested C interface to Condition Variables
[simgrid.git] / include / simgrid / s4u / ConditionVariable.hpp
index e2f5cce..f11df5c 100644 (file)
@@ -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,6 +6,8 @@
 #ifndef SIMGRID_S4U_COND_VARIABLE_HPP
 #define SIMGRID_S4U_COND_VARIABLE_HPP
 
+#include <simgrid/forward.h>
+
 #include <simgrid/chrono.hpp>
 #include <simgrid/s4u/Mutex.hpp>
 
@@ -23,23 +25,18 @@ namespace s4u {
  */
 class XBT_PUBLIC ConditionVariable {
 private:
-#ifndef DOXYGEN
   friend kernel::activity::ConditionVariableImpl;
-  smx_cond_t cond_;
-#endif
-  explicit ConditionVariable(smx_cond_t cond) : cond_(cond) {}
+  kernel::activity::ConditionVariableImpl* const cond_;
+
 public:
+  explicit ConditionVariable(kernel::activity::ConditionVariableImpl* cond) : cond_(cond) {}
   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<ConditionVariable>;
-
-  static Ptr create();
 
-  /** @deprecated See Comm::get_mailbox() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") Ptr createConditionVariable() { return create(); }
+  static ConditionVariablePtr create();
 
   //  Wait functions without time:
 
@@ -100,8 +97,7 @@ public:
   void notify_all();
 };
 
-using ConditionVariablePtr = ConditionVariable::Ptr;
-}
-} // namespace simgrid::s4u
+} // namespace s4u
+} // namespace simgrid
 
 #endif