ScopedARWReadLock Class Reference

#include <arwlock.h>

详细描述

The ScopedARWReadLock class acquires a read lock to the specified mutex upon creation and releases this upon destruction (usually at the end of a code block. This simplifies cases where your code contains many return statements where you'd otherwise have to manually unlock before returning. Only use ScopedARWReadLock for a short block of your code. Do not use ScopedARWReadLock mindlessly at the beginning of a function! This will block all other threads for the whole runtime of the function which usually is much longer that required.

THREADSAFE.

公共成员函数

  ScopedARWReadLock ( ARWLock &lock)
  ScopedARWReadLock ( ScopedARWReadLock && src )
  ~ScopedARWReadLock ()

私有成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( ScopedARWReadLock )

Private Attributes

ARWLock _lock

构造函数 & 析构函数文档编制

◆  ScopedARWReadLock() [1/2]

ScopedARWReadLock ( ARWLock lock )
explicit

◆  ScopedARWReadLock() [2/2]

ScopedARWReadLock ( ScopedARWReadLock &&  src )

◆  ~ScopedARWReadLock()

~ ScopedARWReadLock ( )

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( ScopedARWReadLock   )
private

Member Data Documentation

◆  _lock

ARWLock * _lock
private