Libthreadar
1.4.0
|
the class barrier allows several threads to synchronize between them More...
#include <barrier.hpp>
Public Member Functions | |
barrier (unsigned int num) | |
The constructor. More... | |
barrier (const barrier &ref)=delete | |
no copy constructor | |
barrier (barrier &&ref) noexcept=default | |
no move constructor | |
barrier & | operator= (const barrier &ref)=delete |
no assignment operator | |
barrier & | operator= (barrier &&ref) noexcept=default |
no move operator | |
~barrier () noexcept(false) | |
The destructor. More... | |
void | wait () |
suspend the calling thread waiting for other up to 'num' other thread to call wait too More... | |
unsigned int | get_count () const |
return the barrier size | |
unsigned int | get_waiting_count () const |
return the number of thread waiting on the barrier or just released from it More... | |
Static Public Member Functions | |
static std::string | used_implementation () |
the class barrier allows several threads to synchronize between them
the number of thread to synchronize is given in the constructor argument 'num'. All thread calling the wait() method get locked until 'num' thread(s) have called this wait() method at which time they are all unlocked. The barrier object is then ready for a new cycle.
Definition at line 56 of file barrier.hpp.
libthreadar::barrier::barrier | ( | unsigned int | num | ) |
The constructor.
[in] | num | is the number of thread to synchronize |
|
noexcept |
The destructor.
|
inline |
return the number of thread waiting on the barrier or just released from it
Definition at line 95 of file barrier.hpp.
void libthreadar::barrier::wait | ( | ) |
suspend the calling thread waiting for other up to 'num' other thread to call wait too