Also, use ActorImpl::throw_exception() instead of messing with its
wannabe private exception_ field.
/* If the host running the synchro failed, notice it. This way, the asking
* actor can be killed if it runs on that host itself */
result = SIMIX_SRC_HOST_FAILURE;
/* If the host running the synchro failed, notice it. This way, the asking
* actor can be killed if it runs on that host itself */
result = SIMIX_SRC_HOST_FAILURE;
- simcall->issuer->exception =
- std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
+ simcall->issuer->throw_exception(
+ std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed")));
}
switch (surf_sleep->get_state()) {
}
switch (surf_sleep->get_state()) {
smx_activity_t ActorImpl::sleep(double duration)
{
if (host_->is_off())
smx_activity_t ActorImpl::sleep(double duration)
{
if (host_->is_off())
- throw new simgrid::HostFailureException(XBT_THROW_POINT,
- std::string("Host ") + std::string(host_->get_cname())+" failed, you cannot sleep there.");
+ throw_exception(std::make_exception_ptr(simgrid::HostFailureException(
+ XBT_THROW_POINT, std::string("Host ") + std::string(host_->get_cname()) + " failed, you cannot sleep there.")));
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host_;
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host_;
/* destroy the blocking synchro if any */
if (process->waiting_synchro != nullptr) {
if (process->host_->is_off())
/* destroy the blocking synchro if any */
if (process->waiting_synchro != nullptr) {
if (process->host_->is_off())
- process->exception = std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
+ process->throw_exception(std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed")));
simgrid::kernel::activity::ExecImplPtr exec =
boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
simgrid::kernel::activity::CommImplPtr comm =
simgrid::kernel::activity::ExecImplPtr exec =
boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
simgrid::kernel::activity::CommImplPtr comm =