Class RWLock

Synopsis

#include <src/uvw/thread.h>

class RWLock final: public UnderlyingType<RWLock, uv_rwlock_t>

Description

The RWLock wrapper.

Inheritance

Ancestors: UnderlyingType

Methods

RWLock
~RWLock
rdLockLocks a read-write lock object for reading.
rdUnlockUnlocks a read-write lock object previously locked for reading.
tryRdLockTries to lock a read-write lock object for reading.
tryWrLockTries to lock a read-write lock object for writing.
wrLockLocks a read-write lock object for writing.
wrUnlockUnlocks a read-write lock object previously locked for writing.

Source

Lines 213-250 in src/uvw/thread.h.

class RWLock final: public UnderlyingType<RWLock, uv_rwlock_t> {
public:
    explicit RWLock(ConstructorAccess ca, std::shared_ptr<Loop> ref) noexcept;

    ~RWLock() noexcept;

    /**
     * @brief Locks a read-write lock object for reading.
     */
    void rdLock() noexcept;

    /**
     * @brief Tries to lock a read-write lock object for reading.
     * @return True in case of success, false otherwise.
     */
    bool tryRdLock() noexcept;

    /**
     * @brief Unlocks a read-write lock object previously locked for reading.
     */
    void rdUnlock() noexcept;

    /**
     * @brief Locks a read-write lock object for writing.
     */
    void wrLock() noexcept;

    /**
     * @brief Tries to lock a read-write lock object for writing.
     * @return True in case of success, false otherwise.
     */
    bool tryWrLock() noexcept;

    /**
     * @brief Unlocks a read-write lock object previously locked for writing.
     */
    void wrUnlock() noexcept;
};





Add Discussion as Guest

Log in