-/* Copyright (c) 2006-2017. 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. */
#ifndef SIMGRID_S4U_COND_VARIABLE_HPP
#define SIMGRID_S4U_COND_VARIABLE_HPP
-#include <chrono>
-#include <condition_variable>
-#include <future>
-#include <mutex>
-#include <utility> // std::swap
-
-#include <boost/intrusive_ptr.hpp>
-
-#include <xbt/base.h>
+#include <simgrid/forward.h>
#include <simgrid/chrono.hpp>
#include <simgrid/s4u/Mutex.hpp>
-#include <simgrid/simix.h>
+
+#include <future>
namespace simgrid {
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;
- 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<ConditionVariable>;
+ friend XBT_PUBLIC void intrusive_ptr_add_ref(ConditionVariable * cond);
+ friend XBT_PUBLIC void intrusive_ptr_release(ConditionVariable * cond);
- static Ptr createConditionVariable();
+ static ConditionVariablePtr create();
// Wait functions without time:
void notify_one();
void notify_all();
-
- XBT_ATTRIB_DEPRECATED("Use notify_one() instead")
- void notify() { notify_one(); }
};
-using ConditionVariablePtr = ConditionVariable::Ptr;
-}
-} // namespace simgrid::s4u
+} // namespace s4u
+} // namespace simgrid
#endif