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
handle (badly) the timeout exception in wait_for()
[simgrid.git]
/
src
/
s4u
/
s4u_Exec.cpp
diff --git
a/src/s4u/s4u_Exec.cpp
b/src/s4u/s4u_Exec.cpp
index
b16393c
..
7048f1b
100644
(file)
--- a/
src/s4u/s4u_Exec.cpp
+++ b/
src/s4u/s4u_Exec.cpp
@@
-3,6
+3,7
@@
/* 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 "simgrid/Exception.hpp"
#include "simgrid/exec.h"
#include "simgrid/s4u/Actor.hpp"
#include "simgrid/s4u/Exec.hpp"
#include "simgrid/exec.h"
#include "simgrid/s4u/Actor.hpp"
#include "simgrid/s4u/Exec.hpp"
@@
-234,6
+235,11
@@
void sg_exec_wait(sg_exec_t exec)
void sg_exec_wait_for(sg_exec_t exec, double timeout)
{
void sg_exec_wait_for(sg_exec_t exec, double timeout)
{
- exec->wait_for(timeout);
+ try {
+ exec->wait_for(timeout);
+ } catch (const simgrid::TimeoutException&) {
+ // FIXME: add better exception handling
+ XBT_DEBUG("Exec reached its timeout");
+ }
exec->unref();
}
exec->unref();
}