Class Barrier

Synopsis

#include <src/uvw/thread.h>

class Barrier final: public UnderlyingType<Barrier, uv_barrier_t>

Description

The Barrier wrapper.

To create a Barrier through a Loop, arguments follow:

  • An unsigned integer that specifies the number of threads that must call wait before any of them successfully return from the call. The value specified must be greater than zero.

Inheritance

Ancestors: UnderlyingType

Methods

Barrier
~Barrier
waitSynchronizes at a barrier.

Source

Lines 347-358 in src/uvw/thread.h.

class Barrier final: public UnderlyingType<Barrier, uv_barrier_t> {
public:
    explicit Barrier(ConstructorAccess ca, std::shared_ptr<Loop> ref, unsigned int count) noexcept;

    ~Barrier() noexcept;

    /**
     * @brief Synchronizes at a barrier.
     * @return True in case of success, false otherwise.
     */
    bool wait() noexcept;
};





Add Discussion as Guest

Log in