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 https://framagit.org/simgrid/simgrid/issues/29
[simgrid.git]
/
teshsuite
/
mc
/
mutex-handling
/
mutex-handling.c
diff --git
a/teshsuite/mc/mutex-handling/mutex-handling.c
b/teshsuite/mc/mutex-handling/mutex-handling.c
index
ca13fd7
..
c367cdf
100644
(file)
--- a/
teshsuite/mc/mutex-handling/mutex-handling.c
+++ b/
teshsuite/mc/mutex-handling/mutex-handling.c
@@
-27,7
+27,7
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
#define BOX_NAME "box"
#ifndef DISABLE_THE_MUTEX
#define BOX_NAME "box"
#ifndef DISABLE_THE_MUTEX
-static
xbt
_mutex_t mutex = NULL;
+static
sg
_mutex_t mutex = NULL;
#endif
static int receiver(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
#endif
static int receiver(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
@@
-50,11
+50,11
@@
static int sender(int argc, char *argv[])
xbt_assert(argc == 2);
char* message_name = argv[1];
#ifndef DISABLE_THE_MUTEX
xbt_assert(argc == 2);
char* message_name = argv[1];
#ifndef DISABLE_THE_MUTEX
-
xbt_mutex_acquire
(mutex);
+
sg_mutex_lock
(mutex);
#endif
MSG_task_send(MSG_task_create(message_name, 0.0, 0.0, NULL), BOX_NAME);
#ifndef DISABLE_THE_MUTEX
#endif
MSG_task_send(MSG_task_create(message_name, 0.0, 0.0, NULL), BOX_NAME);
#ifndef DISABLE_THE_MUTEX
-
xbt_mutex_release
(mutex);
+
sg_mutex_unlock
(mutex);
#endif
return 0;
}
#endif
return 0;
}
@@
-71,11
+71,12
@@
int main(int argc, char *argv[])
MSG_launch_application(argv[2]);
#ifndef DISABLE_THE_MUTEX
MSG_launch_application(argv[2]);
#ifndef DISABLE_THE_MUTEX
- mutex =
xbt
_mutex_init();
+ mutex =
sg
_mutex_init();
#endif
msg_error_t res = MSG_main();
#ifndef DISABLE_THE_MUTEX
#endif
msg_error_t res = MSG_main();
#ifndef DISABLE_THE_MUTEX
- xbt_mutex_destroy(mutex); mutex = NULL;
+ sg_mutex_destroy(mutex);
+ mutex = NULL;
#endif
XBT_INFO("Simulation time %g", MSG_get_clock());
#endif
XBT_INFO("Simulation time %g", MSG_get_clock());