Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
3bb881d543b8b1ca1607aa05537237fd65b9f6ec
[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 simgrid::simix::Raw::~Raw()
13 {
14   sleep->unref();
15 }
16 void simgrid::simix::Raw::suspend()
17 {
18   /* The suspension of raw synchros is delayed to when the process is rescheduled. */
19 }
20
21 void simgrid::simix::Raw::resume()
22 {
23   /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
24    * the end of the synchro. */
25 }
26 void simgrid::simix::Raw::post()
27 {
28   XBT_IN("(%p)",this);
29   if (sleep->getState() == simgrid::surf::Action::State::failed)
30     state = SIMIX_FAILED;
31   else if(sleep->getState() == simgrid::surf::Action::State::done)
32     state = SIMIX_SRC_TIMEOUT;
33
34   SIMIX_synchro_finish(this);
35   XBT_OUT();
36 }