Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / src / kernel / activity / SynchroRaw.cpp
1 /* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
2
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. */
5
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"
10
11 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
12
13 simgrid::kernel::activity::RawImpl::~RawImpl()
14 {
15   sleep->unref();
16 }
17 void simgrid::kernel::activity::RawImpl::suspend()
18 {
19   /* The suspension of raw synchros is delayed to when the process is rescheduled. */
20 }
21
22 void simgrid::kernel::activity::RawImpl::resume()
23 {
24   /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
25    * the end of the synchro. */
26 }
27 void simgrid::kernel::activity::RawImpl::post()
28 {
29   XBT_IN("(%p)",this);
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;
34
35   SIMIX_synchro_finish(this);
36   XBT_OUT();
37 }