Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further split the kernel/resource module in separate files
[simgrid.git] / src / kernel / activity / SynchroRaw.cpp
1 /* Copyright (c) 2007-2017. 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 "src/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->getState() == simgrid::surf::Action::State::failed)
31     state = SIMIX_FAILED;
32   else if(sleep->getState() == simgrid::surf::Action::State::done)
33     state = SIMIX_SRC_TIMEOUT;
34
35   SIMIX_synchro_finish(this);
36   XBT_OUT();
37 }