1 /* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_KERNEL_ACTIVITY_SYNCHRO_RAW_HPP
7 #define SIMGRID_KERNEL_ACTIVITY_SYNCHRO_RAW_HPP
9 #include "src/kernel/activity/ActivityImpl.hpp"
17 /** Used to implement mutexes, semaphores and conditions */
18 class XBT_PUBLIC SynchroImpl : public ActivityImpl_T<SynchroImpl> {
19 sg_host_t host_ = nullptr;
21 std::function<void()> finish_callback_;
24 explicit SynchroImpl(const std::function<void()>& finish_callback) : finish_callback_(finish_callback) {}
25 SynchroImpl& set_host(s4u::Host* host);
26 SynchroImpl& set_timeout(double timeout) override;
29 void suspend() override;
30 void resume() override;
31 void cancel() override;
33 void set_exception(actor::ActorImpl* issuer) override;
34 void finish() override;
36 } // namespace activity
38 } // namespace simgrid