Primitives useful for multithreaded applications, for example, atomic counters, condition variables, and locks.
More...
Primitives useful for multithreaded applications, for example, atomic counters, condition variables, and locks.
mi::base::Lock::Block::Block |
( |
Lock * |
lock = 0 ) |
|
|
|
inlineexplicit |
Constructor.
- Parameters
-
lock |
If not NULL , this lock is acquired. If NULL , set() can be used to explicitly acquire a lock later. |
Uint32 mi::base::Atom32::operator++ |
( |
) |
|
|
|
inline |
Increments counter by one.
Uint32 mi::base::Atom32::operator++ |
( |
int |
) |
|
|
|
inline |
Increments counter by one.
Uint32 mi::base::Atom32::operator+= |
( |
const Uint32 |
val) |
|
|
|
inline |
Uint32 mi::base::Atom32::operator-- |
( |
) |
|
|
|
inline |
Decrements counter by one.
Uint32 mi::base::Atom32::operator-- |
( |
int |
) |
|
|
|
inline |
Decrements counter by one.
Uint32 mi::base::Atom32::operator-= |
( |
const Uint32 |
val) |
|
|
|
inline |
Subtracts val
from counter.
void mi::base::Lock::Block::release |
( |
) |
|
|
|
inline |
Releases the lock.
Useful to release the lock before the destructor is called.
void mi::base::Lock::Block::set |
( |
Lock * |
lock) |
|
|
|
inline |
Acquires a lock.
Releases the current lock (if it is set) and acquires the given lock. Useful to acquire a different lock, or to acquire a lock if no lock was acquired in the constructor.
- Parameters
-
lock |
The new lock to acquire. |
Uint32 mi::base::Atom32::swap |
( |
const Uint32 |
val) |
|
|
|
inline |
Assign val
to counter and return the old value of counter.
mi::base::Lock::Block::~Block |
( |
) |
|
|
|
inline |
Destructor.
Releases the lock (if it is acquired).