---
title: llarp::util::Barrier
summary: Barrier class that blocks all threads until the high water mark of threads (set during construction) is reached, then releases them all. 

---

# llarp::util::Barrier



[Barrier]() class that blocks all threads until the high water mark of threads (set during construction) is reached, then releases them all. 


`#include <barrier.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[Barrier](Classes/classllarp_1_1util_1_1Barrier.md#function-barrier)**(unsigned threads) |
| bool | **[Block](Classes/classllarp_1_1util_1_1Barrier.md#function-block)**()<br>Returns true if _this_ Block call is the one that releases all of them; returns false (i.e.  |

## Public Functions Documentation

### function Barrier

```cpp
inline Barrier(
    unsigned threads
)
```


### function Block

```cpp
inline bool Block()
```

Returns true if _this_ Block call is the one that releases all of them; returns false (i.e. 

after unblocking) if some other thread triggered the released. 


-------------------------------

Updated on 2022-10-06 at 19:25:19 +0000