1 /* Copyright (c) 2012-2019. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_KERNEL_ACTIVITY_CONDITIONVARIABLEIMPL_HPP
7 #define SIMGRID_KERNEL_ACTIVITY_CONDITIONVARIABLEIMPL_HPP
9 #include "simgrid/s4u/ConditionVariable.hpp"
10 #include "src/kernel/actor/ActorImpl.hpp"
11 #include <boost/intrusive/list.hpp>
17 class XBT_PUBLIC ConditionVariableImpl {
19 ConditionVariableImpl();
20 ~ConditionVariableImpl();
22 actor::SynchroList sleeping_; /* list of sleeping processes */
23 MutexImpl* mutex_ = nullptr;
24 s4u::ConditionVariable cond_;
28 void wait(MutexImpl* mutex, double timeout, actor::ActorImpl* issuer, smx_simcall_t simcall);
31 std::atomic_int_fast32_t refcount_{1};
32 friend void intrusive_ptr_add_ref(ConditionVariableImpl* cond);
33 friend void intrusive_ptr_release(ConditionVariableImpl* cond);
35 } // namespace activity
37 } // namespace simgrid