X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/831de10adaaf8910940aa280e2ac2dd075b5ffe5..9b5c287fbf93c2ae7c3d18c8584647ef9920fe87:/src/kernel/activity/SynchroRaw.hpp diff --git a/src/kernel/activity/SynchroRaw.hpp b/src/kernel/activity/SynchroRaw.hpp index 05914c05d2..13953ead95 100644 --- a/src/kernel/activity/SynchroRaw.hpp +++ b/src/kernel/activity/SynchroRaw.hpp @@ -1,28 +1,36 @@ -/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#ifndef _SIMIX_SYNCHRO_RAW_HPP -#define _SIMIX_SYNCHRO_RAW_HPP +#ifndef SIMIX_SYNCHRO_RAW_HPP +#define SIMIX_SYNCHRO_RAW_HPP -#include "surf/surf.h" -#include "src/kernel/activity/Synchro.h" +#include "src/kernel/activity/ActivityImpl.hpp" +#include "surf/surf.hpp" namespace simgrid { -namespace simix { +namespace kernel { +namespace activity { /** Used to implement mutexes, semaphores and conditions */ - XBT_PUBLIC_CLASS Raw : public Synchro { - public: - ~Raw() override; - void suspend() override; - void resume() override; - void post() override; - - surf_action_t sleep = nullptr; - }; - -}} // namespace simgrid::simix +class XBT_PUBLIC RawImpl : public ActivityImpl_T { + sg_host_t host_ = nullptr; + double timeout_ = -1; + +public: + RawImpl& set_host(s4u::Host* host); + RawImpl& set_timeout(double timeout); + + RawImpl* start(); + void suspend() override; + void resume() override; + void cancel() override; + void post() override; + void finish() override; +}; +} // namespace activity +} // namespace kernel +} // namespace simgrid #endif