neuray API Programmer's Manual

mi::base::Lock Class Reference

[Multithreading Support]

Description

Non-recursive lock class. The lock implements a critical region that only one thread can enter at a time. The lock is non-recursive, i.e., a thread that holds the lock can not lock it again. Any attempt to do so will abort the process.

Other pre- and post-conditions are checked via mi_base_assert.

See also:

mi::base::Lock::Block

Public Inner Classes

class 
Utility class to acquire a lock that is released by the destructor. More...

Public Constructors

 Lock()
Constructor.

Public Destructors

 ~Lock()
Destructor.

Protected Member Functions

void lock()
Locks the lock.
bool  try_lock()
Tries to lock the lock.
void unlock()
Unlocks the lock.

Constructors

mi::​base::​Lock::Lock()

Constructor.

Destructors

mi::​base::​Lock::~Lock()

Destructor.

Member Functions

void mi::​base::​Lock::lock() [protected]

Locks the lock.

bool mi::​base::​Lock::try_lock() [protected]

Tries to lock the lock.

void mi::​base::​Lock::unlock() [protected]

Unlocks the lock.