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
Merge branch 'xbt_random' into 'master'
[simgrid.git]
/
include
/
simgrid
/
s4u
/
Barrier.hpp
diff --git
a/include/simgrid/s4u/Barrier.hpp
b/include/simgrid/s4u/Barrier.hpp
index
92ece5a
..
db8e05e
100644
(file)
--- a/
include/simgrid/s4u/Barrier.hpp
+++ b/
include/simgrid/s4u/Barrier.hpp
@@
-6,9
+6,10
@@
#ifndef SIMGRID_S4U_BARRIER_HPP
#define SIMGRID_S4U_BARRIER_HPP
#ifndef SIMGRID_S4U_BARRIER_HPP
#define SIMGRID_S4U_BARRIER_HPP
+#include <simgrid/barrier.h>
+#include <simgrid/chrono.hpp>
#include <simgrid/forward.h>
#include <simgrid/s4u/ConditionVariable.hpp>
#include <simgrid/forward.h>
#include <simgrid/s4u/ConditionVariable.hpp>
-#include <simgrid/chrono.hpp>
#include <simgrid/s4u/Mutex.hpp>
#include <atomic>
#include <simgrid/s4u/Mutex.hpp>
#include <atomic>
@@
-21,26
+22,31
@@
class XBT_PUBLIC Barrier {
private:
MutexPtr mutex_;
ConditionVariablePtr cond_;
private:
MutexPtr mutex_;
ConditionVariablePtr cond_;
- unsigned int expected_
processe
s_;
- unsigned int arrived_
processe
s_ = 0;
+ unsigned int expected_
actor
s_;
+ unsigned int arrived_
actor
s_ = 0;
/* refcounting */
std::atomic_int_fast32_t refcount_{0};
public:
/* refcounting */
std::atomic_int_fast32_t refcount_{0};
public:
+ /** Creates a barrier for the given amount of actors */
explicit Barrier(unsigned int count);
explicit Barrier(unsigned int count);
+#ifndef DOXYGEN
~Barrier() = default;
Barrier(Barrier const&) = delete;
Barrier& operator=(Barrier const&) = delete;
~Barrier() = default;
Barrier(Barrier const&) = delete;
Barrier& operator=(Barrier const&) = delete;
+#endif
- /** C
onstructs a new barrier
*/
- static BarrierPtr create(unsigned int expected_
processe
s);
-
+ /** C
reates a barrier for the given amount of actors
*/
+ static BarrierPtr create(unsigned int expected_
actor
s);
+ /** Blocks into the barrier. Every waiting actors will be unlocked once the expected amount of actors reaches the barrier */
int wait();
int wait();
+#ifndef DOXYGEN
/* refcounting */
friend XBT_PUBLIC void intrusive_ptr_add_ref(Barrier* barrier);
friend XBT_PUBLIC void intrusive_ptr_release(Barrier* barrier);
/* refcounting */
friend XBT_PUBLIC void intrusive_ptr_add_ref(Barrier* barrier);
friend XBT_PUBLIC void intrusive_ptr_release(Barrier* barrier);
+#endif
};
} // namespace s4u
} // namespace simgrid
};
} // namespace s4u
} // namespace simgrid