libfilezilla
Public Member Functions | List of all members
scoped_write_lock Class Referencefinal

A simple scoped read lock. More...

#include <rwmutex.hpp>

Public Member Functions

 scoped_write_lock (rwmutex &m)
 
 scoped_write_lock (scoped_write_lock const &)=delete
 
scoped_write_lockoperator= (scoped_write_lock const &)=delete
 
 scoped_write_lock (scoped_write_lock &&op) noexcept
 
scoped_write_lockoperator= (scoped_write_lock &&op) noexcept
 
void lock ()
 Obtains the mutex. More...
 
void unlock ()
 Releases the mutex. More...
 

Detailed Description

A simple scoped read lock.

The lock is acquired on construction and, if still locked, released on destruction. You can manually unlock and re-lock if needed.

Member Function Documentation

◆ lock()

void lock ( )
inline

Obtains the mutex.

Locking an already locked scoped_write_lock results in undefined behavior.

◆ unlock()

void unlock ( )
inline

Releases the mutex.

Releasing a scoped_write_lock that isn't locked results in undefined behavior.


The documentation for this class was generated from the following file: