Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use namespaces
[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 namespace simgrid {
13 namespace kernel {
14 namespace activity {
15
16 RawImpl::~RawImpl()
17 {
18   surf_action_->unref();
19 }
20 void RawImpl::suspend()
21 {
22   /* The suspension of raw synchros is delayed to when the process is rescheduled. */
23 }
24
25 void RawImpl::resume()
26 {
27   /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
28    * the end of the synchro. */
29 }
30 void RawImpl::post()
31 {
32   XBT_IN("(%p)",this);
33   if (surf_action_->get_state() == resource::Action::State::FAILED)
34     state_ = SIMIX_FAILED;
35   else if (surf_action_->get_state() == resource::Action::State::FINISHED)
36     state_ = SIMIX_SRC_TIMEOUT;
37
38   SIMIX_synchro_finish(this);
39   XBT_OUT();
40 }
41 } // namespace activity
42 } // namespace kernel
43 } // namespace simgrid