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
Fix MC
[simgrid.git]
/
src
/
s4u
/
s4u_mutex.cpp
diff --git
a/src/s4u/s4u_mutex.cpp
b/src/s4u/s4u_mutex.cpp
index
20f6ee2
..
e64bfd4
100644
(file)
--- a/
src/s4u/s4u_mutex.cpp
+++ b/
src/s4u/s4u_mutex.cpp
@@
-10,22
+10,20
@@
#include "simgrid/s4u/mutex.hpp"
#include "simgrid/s4u/mutex.hpp"
+namespace simgrid {
+namespace s4u {
-using namespace simgrid;
-
-s4u::Mutex::Mutex() {
- smx_mutex_t smx_mutex = simcall_mutex_init();
- _mutex = std::shared_ptr<simgrid::simix::Mutex>(smx_mutex, SIMIX_mutex_destroy );
+void Mutex::lock() {
+ simcall_mutex_lock(mutex_);
}
}
-void
s4u::Mutex::
lock() {
- simcall_mutex_
lock(_mutex.get()
);
+void
Mutex::un
lock() {
+ simcall_mutex_
unlock(mutex_
);
}
}
-
void s4u::Mutex::un
lock() {
-
simcall_mutex_unlock(_mutex.get()
);
+
bool Mutex::try_
lock() {
+
return simcall_mutex_trylock(mutex_
);
}
}
-bool s4u::Mutex::try_lock() {
- return simcall_mutex_trylock(_mutex.get());
+}
}
}