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 some issues with Cancel
[simgrid.git]
/
src
/
s4u
/
s4u_Comm.cpp
diff --git
a/src/s4u/s4u_Comm.cpp
b/src/s4u/s4u_Comm.cpp
index
50eaf00
..
7eb4685
100644
(file)
--- a/
src/s4u/s4u_Comm.cpp
+++ b/
src/s4u/s4u_Comm.cpp
@@
-167,6
+167,8
@@
Comm* Comm::wait_for(double timeout)
state_ = State::FINISHED;
return this;
state_ = State::FINISHED;
return this;
+ case State::CANCELED:
+ return this;
default:
THROW_IMPOSSIBLE;
}
default:
THROW_IMPOSSIBLE;
}
@@
-193,7
+195,10
@@
Comm* Comm::detach()
Comm* Comm::cancel()
{
Comm* Comm::cancel()
{
- simgrid::simix::simcall([this] { static_cast<kernel::activity::CommImpl*>(pimpl_.get())->cancel(); });
+ simgrid::simix::simcall([this] {
+ if (pimpl_)
+ boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->cancel();
+ });
state_ = State::CANCELED;
return this;
}
state_ = State::CANCELED;
return this;
}