A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove empty functions
[simgrid.git]
/
src
/
kernel
/
activity
/
MutexImpl.hpp
diff --git
a/src/kernel/activity/MutexImpl.hpp
b/src/kernel/activity/MutexImpl.hpp
index
37846cb
..
27a47c1
100644
(file)
--- a/
src/kernel/activity/MutexImpl.hpp
+++ b/
src/kernel/activity/MutexImpl.hpp
@@
-16,21
+16,20
@@
namespace activity {
class XBT_PUBLIC MutexImpl {
public:
class XBT_PUBLIC MutexImpl {
public:
- MutexImpl();
- ~MutexImpl();
+ MutexImpl() : piface_(this) {}
MutexImpl(MutexImpl const&) = delete;
MutexImpl& operator=(MutexImpl const&) = delete;
MutexImpl(MutexImpl const&) = delete;
MutexImpl& operator=(MutexImpl const&) = delete;
- void lock(
smx_actor_t
issuer);
- bool try_lock(
smx_actor_t
issuer);
- void unlock(
smx_actor_t
issuer);
+ void lock(
actor::ActorImpl*
issuer);
+ bool try_lock(
actor::ActorImpl*
issuer);
+ void unlock(
actor::ActorImpl*
issuer);
MutexImpl* ref();
void unref();
MutexImpl* ref();
void unref();
- bool locked = false;
-
smx_actor_t owner
= nullptr;
- // List of sleeping
processe
s:
-
simgrid::kernel::actor::SynchroList sleeping
;
+ bool locked
_
= false;
+
actor::ActorImpl* owner_
= nullptr;
+ // List of sleeping
actor
s:
+
actor::SynchroList sleeping_
;
// boost::intrusive_ptr<Mutex> support:
friend void intrusive_ptr_add_ref(MutexImpl* mutex)
// boost::intrusive_ptr<Mutex> support:
friend void intrusive_ptr_add_ref(MutexImpl* mutex)
@@
-38,17
+37,18
@@
public:
XBT_ATTRIB_UNUSED auto previous = mutex->refcount_.fetch_add(1);
xbt_assert(previous != 0);
}
XBT_ATTRIB_UNUSED auto previous = mutex->refcount_.fetch_add(1);
xbt_assert(previous != 0);
}
+
friend void intrusive_ptr_release(MutexImpl* mutex)
{
if (mutex->refcount_.fetch_sub(1) == 1)
delete mutex;
}
friend void intrusive_ptr_release(MutexImpl* mutex)
{
if (mutex->refcount_.fetch_sub(1) == 1)
delete mutex;
}
- s
imgrid::s
4u::Mutex& mutex() { return piface_; }
+ s4u::Mutex& mutex() { return piface_; }
private:
std::atomic_int_fast32_t refcount_{1};
private:
std::atomic_int_fast32_t refcount_{1};
- s
imgrid::s
4u::Mutex piface_;
+ s4u::Mutex piface_;
};
}
}
};
}
}