#include "src/kernel/actor/ActorImpl.hpp"
#include <boost/intrusive/list.hpp>
-namespace simgrid {
-namespace kernel {
-namespace activity {
+namespace simgrid::kernel::activity {
/** Mutex Acquisition: the act / process of acquiring the mutex.
*
* of a set if some transitions may become disabled in between, while you don't have to reconsider them if you can reuse
* your previous computations).
*/
-class XBT_PUBLIC MutexAcquisitionImpl
- : public ActivityImpl_T<MutexAcquisitionImpl> { // Acquisition: n. The act or process of acquiring.
+class XBT_PUBLIC MutexAcquisitionImpl : public ActivityImpl_T<MutexAcquisitionImpl> {
actor::ActorImpl* issuer_ = nullptr;
MutexImpl* mutex_ = nullptr;
std::atomic_int_fast32_t refcount_{1};
s4u::Mutex piface_;
actor::ActorImpl* owner_ = nullptr;
- // List of sleeping actors:
- std::deque<MutexAcquisitionImplPtr> sleeping_;
+ std::deque<MutexAcquisitionImplPtr> ongoing_acquisitions_;
static unsigned next_id_;
- unsigned id_;
+ unsigned id_ = next_id_++;
friend MutexAcquisitionImpl;
public:
- MutexImpl() : piface_(this), id_(next_id_++) {}
+ MutexImpl() : piface_(this) {}
MutexImpl(MutexImpl const&) = delete;
MutexImpl& operator=(MutexImpl const&) = delete;
s4u::Mutex& mutex() { return piface_; }
};
-} // namespace activity
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::activity
#endif