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
Make suspending/resuming a suspended/non-suspended process a no-op
[simgrid.git]
/
src
/
simix
/
smx_process.c
diff --git
a/src/simix/smx_process.c
b/src/simix/smx_process.c
index
0b150c8
..
ac73df5
100644
(file)
--- a/
src/simix/smx_process.c
+++ b/
src/simix/smx_process.c
@@
-316,6
+316,13
@@
void SIMIX_pre_process_suspend(smx_req_t req)
void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
{
void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
{
+ xbt_assert((process != NULL), "Invalid parameters");
+
+ if (process->suspended) {
+ XBT_DEBUG("Process '%s' is already suspended", process->name);
+ return;
+ }
+
process->suspended = 1;
/* If we are suspending another process, and it is waiting on an action,
process->suspended = 1;
/* If we are suspending another process, and it is waiting on an action,
@@
-350,6
+357,11
@@
void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
{
xbt_assert((process != NULL), "Invalid parameters");
{
xbt_assert((process != NULL), "Invalid parameters");
+ if (!process->suspended) {
+ XBT_DEBUG("Process '%s' is not suspended", process->name);
+ return;
+ }
+
process->suspended = 0;
/* If we are resuming another process, resume the action it was waiting for
process->suspended = 0;
/* If we are resuming another process, resume the action it was waiting for