Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use C++ to implement dynamic dispatch
[simgrid.git] / src / simix / SynchroRaw.cpp
1 /* Copyright (c) 2007-2016. 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/simix/SynchroRaw.hpp"
7 #include "src/surf/surf_interface.hpp"
8 #include "src/simix/smx_synchro_private.h"
9
10 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
11
12 void simgrid::simix::Raw::suspend()
13 {
14   /* The suspension of raw synchros is delayed to when the process is rescheduled. */
15 }
16
17 void simgrid::simix::Raw::resume()
18 {
19   /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
20    * the end of the synchro. */
21 }
22 void simgrid::simix::Raw::post()
23 {
24   XBT_IN("(%p)",this);
25   if (sleep->getState() == simgrid::surf::Action::State::failed)
26     state = SIMIX_FAILED;
27   else if(sleep->getState() == simgrid::surf::Action::State::done)
28     state = SIMIX_SRC_TIMEOUT;
29
30   SIMIX_synchro_finish(this);
31   XBT_OUT();
32 }