-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-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. */
#include <boost/intrusive/list.hpp>
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
-class XBT_PUBLIC() MutexImpl {
+class XBT_PUBLIC MutexImpl {
public:
MutexImpl();
~MutexImpl();
bool try_lock(smx_actor_t issuer);
void unlock(smx_actor_t issuer);
+ MutexImpl* ref();
+ void unref();
bool locked = false;
smx_actor_t owner = nullptr;
// List of sleeping processes:
- simgrid::simix::SynchroList sleeping;
+ simgrid::kernel::actor::SynchroList sleeping;
// boost::intrusive_ptr<Mutex> support:
friend void intrusive_ptr_add_ref(MutexImpl* mutex)
delete mutex;
}
- simgrid::s4u::Mutex& mutex() { return mutex_; }
+ simgrid::s4u::Mutex& mutex() { return piface_; }
private:
std::atomic_int_fast32_t refcount_{1};
- simgrid::s4u::Mutex mutex_;
+ simgrid::s4u::Mutex piface_;
};
}
}
+}
#endif /* SIMIX_MUTEXIMPL_HPP */