Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more chaining for CPUs too
[simgrid.git] / include / simgrid / s4u / ConditionVariable.hpp
index 7b0cab04d49466e990baf74be03bafe7a02eb33c..de52bde921f3a34cc1220ba0eacec59d86acd51a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2021. 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. */
@@ -17,7 +17,7 @@ namespace simgrid {
 namespace s4u {
 
 /**
- * @rst
+ * @beginrst
  * SimGrid's condition variables are meant to be drop-in replacements of ``std::condition_variable``.
  * Please refer to the `documentation of standard C++ <https://en.cppreference.com/w/cpp/thread/condition_variable>`_
  * for more information on condition variables. A SimGrid example is available in Section :ref:`s4u_ex_IPC`.
@@ -26,12 +26,13 @@ namespace s4u {
 class XBT_PUBLIC ConditionVariable {
 private:
   friend kernel::activity::ConditionVariableImpl;
-  kernel::activity::ConditionVariableImpl* const cond_;
+  friend void kernel::activity::intrusive_ptr_release(kernel::activity::ConditionVariableImpl* cond);
 
-public:
-#ifndef DOXYGEN
-  explicit ConditionVariable(kernel::activity::ConditionVariableImpl* cond) : cond_(cond) {}
+  kernel::activity::ConditionVariableImpl* const pimpl_;
 
+  explicit ConditionVariable(kernel::activity::ConditionVariableImpl* cond) : pimpl_(cond) {}
+  ~ConditionVariable() = default;
+#ifndef DOXYGEN
   ConditionVariable(ConditionVariable const&) = delete;
   ConditionVariable& operator=(ConditionVariable const&) = delete;
 
@@ -39,9 +40,10 @@ public:
   friend XBT_PUBLIC void intrusive_ptr_release(const ConditionVariable* cond);
 #endif
 
+public:
   /** Create a new condition variable and return a smart pointer
    *
-   * @rst
+   * @beginrst
    * You should only manipulate :cpp:type:`simgrid::s4u::ConditionVariablePtr`, as created by this function (see also :ref:`s4u_raii`).
    * @endrst
    */