From 98c282b89b7655c6bcf59ff44662325b40a16754 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Sun, 29 Jul 2018 01:13:04 +0200 Subject: [PATCH] uniformity in Activity cancel() --- src/s4u/s4u_Comm.cpp | 5 ++--- src/s4u/s4u_Exec.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index c231d1e59e..0b57262abd 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -184,9 +184,8 @@ Activity* Comm::detach() Activity* Comm::cancel() { - simgrid::kernel::activity::CommImplPtr commPimpl = - boost::static_pointer_cast(pimpl_); - commPimpl->cancel(); + simgrid::simix::simcall([this] { dynamic_cast(pimpl_.get())->cancel(); }); + state_ = State::CANCELED; return this; } diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 94da9d2bd3..fda9b5bcde 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -22,7 +22,7 @@ Activity* Exec::start() Activity* Exec::cancel() { - simcall_execution_cancel(pimpl_); + simgrid::simix::simcall([this] { dynamic_cast(pimpl_.get())->cancel(); }); state_ = State::CANCELED; return this; } -- 2.20.1