1 /* Copyright (c) 2015-2023. 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_MC_TRANSITION_SYNCHRO_HPP
7 #define SIMGRID_MC_TRANSITION_SYNCHRO_HPP
9 #include "src/mc/transition/Transition.hpp"
13 namespace simgrid::mc {
15 class BarrierTransition : public Transition {
19 std::string to_string(bool verbose) const override;
20 BarrierTransition(aid_t issuer, int times_considered, Type type, std::stringstream& stream);
21 bool depends(const Transition* other) const override;
24 class MutexTransition : public Transition {
29 std::string to_string(bool verbose) const override;
30 MutexTransition(aid_t issuer, int times_considered, Type type, std::stringstream& stream);
31 bool depends(const Transition* other) const override;
33 uintptr_t get_mutex() const { return this->mutex_; }
34 aid_t get_owner() const { return this->owner_; }
37 class SemaphoreTransition : public Transition {
38 unsigned int sem_; // ID
43 std::string to_string(bool verbose) const override;
44 SemaphoreTransition(aid_t issuer, int times_considered, Type type, std::stringstream& stream);
45 bool depends(const Transition* other) const override;
46 int get_capacity() const { return capacity_; }
49 } // namespace simgrid::mc