1 /* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "src/kernel/activity/SynchroRaw.hpp"
7 #include "simgrid/kernel/resource/Action.hpp"
8 #include "src/simix/smx_synchro_private.hpp"
9 #include "src/surf/surf_interface.hpp"
11 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
13 simgrid::kernel::activity::RawImpl::~RawImpl()
17 void simgrid::kernel::activity::RawImpl::suspend()
19 /* The suspension of raw synchros is delayed to when the process is rescheduled. */
22 void simgrid::kernel::activity::RawImpl::resume()
24 /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
25 * the end of the synchro. */
27 void simgrid::kernel::activity::RawImpl::post()
30 if (sleep->get_state() == simgrid::kernel::resource::Action::State::FAILED)
31 state_ = SIMIX_FAILED;
32 else if (sleep->get_state() == simgrid::kernel::resource::Action::State::FINISHED)
33 state_ = SIMIX_SRC_TIMEOUT;
35 SIMIX_synchro_finish(this);