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
smpirun: really disable privatization with -no-privatize.
[simgrid.git]
/
src
/
xbt
/
xbt_os_synchro.cpp
diff --git
a/src/xbt/xbt_os_synchro.cpp
b/src/xbt/xbt_os_synchro.cpp
index
d27ae64
..
eb1aecc
100644
(file)
--- a/
src/xbt/xbt_os_synchro.cpp
+++ b/
src/xbt/xbt_os_synchro.cpp
@@
-6,11
+6,10
@@
/* 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. */
/* 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 "xbt/ex.h"
+#include "xbt/ex.h
pp
"
#include "xbt/synchro.h"
#include "simgrid/simix.h" /* used implementation */
#include "xbt/synchro.h"
#include "simgrid/simix.h" /* used implementation */
-#include "src/simix/smx_synchro_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync, xbt, "Synchronization mechanism");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync, xbt, "Synchronization mechanism");
@@
-32,7
+31,7
@@
int xbt_mutex_try_acquire(xbt_mutex_t mutex)
void xbt_mutex_release(xbt_mutex_t mutex)
{
void xbt_mutex_release(xbt_mutex_t mutex)
{
-
((smx_mutex_t)mutex)->unlock(SIMIX_process_self()
);
+
simcall_mutex_unlock((smx_mutex_t)mutex
);
}
void xbt_mutex_destroy(xbt_mutex_t mutex)
}
void xbt_mutex_destroy(xbt_mutex_t mutex)
@@
-51,9
+50,18
@@
void xbt_cond_wait(xbt_cond_t cond, xbt_mutex_t mutex)
simcall_cond_wait((smx_cond_t)cond, (smx_mutex_t)mutex);
}
simcall_cond_wait((smx_cond_t)cond, (smx_mutex_t)mutex);
}
-
void
xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay)
+
int
xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay)
{
{
- simcall_cond_wait_timeout((smx_cond_t)cond, (smx_mutex_t)mutex, delay);
+ try {
+ simcall_cond_wait_timeout((smx_cond_t)cond, (smx_mutex_t)mutex, delay);
+ } catch (xbt_ex& e) {
+ if (e.category == timeout_error) {
+ return 1;
+ } else {
+ throw; // rethrow the exceptions that I don't know
+ }
+ }
+ return 0;
}
void xbt_cond_signal(xbt_cond_t cond)
}
void xbt_cond_signal(xbt_cond_t cond)