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
[simix] Refcounting with SIMIX_{process,mutex}_{ref,unref}()
[simgrid.git]
/
include
/
simgrid
/
s4u
/
mutex.hpp
diff --git
a/include/simgrid/s4u/mutex.hpp
b/include/simgrid/s4u/mutex.hpp
index
da7c3df
..
201f071
100644
(file)
--- a/
include/simgrid/s4u/mutex.hpp
+++ b/
include/simgrid/s4u/mutex.hpp
@@
-20,14
+20,14
@@
XBT_PUBLIC_CLASS Mutex {
public:
Mutex() :
mutex_(simcall_mutex_init()) {}
public:
Mutex() :
mutex_(simcall_mutex_init()) {}
- Mutex(simgrid::simix::Mutex* mutex) : mutex_(SIMIX_mutex_
dup
(mutex)) {}
+ Mutex(simgrid::simix::Mutex* mutex) : mutex_(SIMIX_mutex_
ref
(mutex)) {}
~Mutex()
{
~Mutex()
{
- SIMIX_mutex_
destroy
(mutex_);
+ SIMIX_mutex_
unref
(mutex_);
}
// Copy+move (with the copy-and-swap idiom):
}
// Copy+move (with the copy-and-swap idiom):
- Mutex(Mutex const& mutex) : mutex_(SIMIX_mutex_
dup
(mutex.mutex_)) {}
+ Mutex(Mutex const& mutex) : mutex_(SIMIX_mutex_
ref
(mutex.mutex_)) {}
friend void swap(Mutex& first, Mutex& second)
{
using std::swap;
friend void swap(Mutex& first, Mutex& second)
{
using std::swap;