A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the conditionVariable observer to the right file
[simgrid.git]
/
src
/
kernel
/
activity
/
BarrierImpl.hpp
diff --git
a/src/kernel/activity/BarrierImpl.hpp
b/src/kernel/activity/BarrierImpl.hpp
index 44736cd3cee8fffe3e288ca5417d23b4ec15bc78..c4dd9e03a68d7634788bb749c1ccf306a6c58404 100644
(file)
--- a/
src/kernel/activity/BarrierImpl.hpp
+++ b/
src/kernel/activity/BarrierImpl.hpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2012-202
2
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-202
3
. 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. */
/* 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. */
@@
-10,10
+10,9
@@
#include "src/kernel/activity/ActivityImpl.hpp"
#include "src/kernel/actor/ActorImpl.hpp"
#include "src/kernel/actor/SynchroObserver.hpp"
#include "src/kernel/activity/ActivityImpl.hpp"
#include "src/kernel/actor/ActorImpl.hpp"
#include "src/kernel/actor/SynchroObserver.hpp"
+#include "xbt/string.hpp"
-namespace simgrid {
-namespace kernel {
-namespace activity {
+namespace simgrid::kernel::activity {
/** Barrier Acquisition: the act / process of acquiring the barrier.
*
* This is the asynchronous activity associated to Barriers. See the doc of MutexImpl for more details on the rationnal.
/** Barrier Acquisition: the act / process of acquiring the barrier.
*
* This is the asynchronous activity associated to Barriers. See the doc of MutexImpl for more details on the rationnal.
@@
-33,9
+32,6
@@
public:
bool test(actor::ActorImpl* issuer = nullptr) override;
void wait_for(actor::ActorImpl* issuer, double timeout) override;
bool test(actor::ActorImpl* issuer = nullptr) override;
void wait_for(actor::ActorImpl* issuer, double timeout) override;
- void post() override
- { /*no surf action*/
- }
void finish() override;
void set_exception(actor::ActorImpl* issuer) override
{ /* nothing to do */
void finish() override;
void set_exception(actor::ActorImpl* issuer) override
{ /* nothing to do */
@@
-46,7
+42,6
@@
class XBT_PUBLIC BarrierImpl {
std::atomic_int_fast32_t refcount_{1};
s4u::Barrier piface_;
unsigned int expected_actors_;
std::atomic_int_fast32_t refcount_{1};
s4u::Barrier piface_;
unsigned int expected_actors_;
- // std::vector<actor::ActorImpl*> arrived_actors_;
std::deque<BarrierAcquisitionImplPtr> ongoing_acquisitions_;
static unsigned next_id_;
unsigned id_ = next_id_++;
std::deque<BarrierAcquisitionImplPtr> ongoing_acquisitions_;
static unsigned next_id_;
unsigned id_ = next_id_++;
@@
-55,7
+50,7
@@
class XBT_PUBLIC BarrierImpl {
friend s4u::Barrier;
public:
friend s4u::Barrier;
public:
- BarrierImpl(int expected_actors) : piface_(this), expected_actors_(expected_actors) {}
+
explicit
BarrierImpl(int expected_actors) : piface_(this), expected_actors_(expected_actors) {}
BarrierImpl(BarrierImpl const&) = delete;
BarrierImpl& operator=(BarrierImpl const&) = delete;
BarrierImpl(BarrierImpl const&) = delete;
BarrierImpl& operator=(BarrierImpl const&) = delete;
@@
-75,8
+70,11
@@
public:
}
s4u::Barrier& get_iface() { return piface_; }
}
s4u::Barrier& get_iface() { return piface_; }
+
+ std::string to_string() const
+ {
+ return xbt::string_printf("Barrier %u: %zu of %u", id_, ongoing_acquisitions_.size(), expected_actors_);
+ }
};
};
-} // namespace activity
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::activity
#endif
#endif