NVIDIA Iray: Math API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Multithreading Support

Primitives useful for multithreaded applications, for example, atomic counters, condition variables, and locks. More...

Classes

class   mi::base::Atom32
  32-bit unsigned counter with atomic arithmetic, increments, and decrements. More...
 
class   mi::base::Condition
  Conditions allow threads to signal an event and to wait for such a signal, respectively. More...
 
class   mi::base::Lock
  Lock class implementing a critical region that only one thread can enter at a time. More...
 

Functions

Uint32  mi::base::Atom32::operator+= (const Uint32 val)
  Adds val to counter. More...
 
Uint32  mi::base::Atom32::operator-= (const Uint32 val)
  Subtracts val from counter. More...
 
Uint32  mi::base::Atom32::operator++ ()
  Increments counter by one. More...
 
Uint32  mi::base::Atom32::operator-- ()
  Decrements counter by one. More...
 
Uint32  mi::base::Atom32::operator++ (int)
  Increments counter by one. More...
 
Uint32  mi::base::Atom32::operator-- (int)
  Decrements counter by one. More...
 
Uint32  mi::base::Atom32::swap (const Uint32 val)
  Assign val to counter and return the old value of counter. More...
 
  mi::base::Lock::Block::Block (Lock *lock=0)
  Constructor. More...
 
  mi::base::Lock::Block::~Block ()
  Destructor. More...
 
void  mi::base::Lock::Block::set (Lock *lock)
  Acquires a lock. More...
 
void  mi::base::Lock::Block::release ()
  Releases the lock. More...
 

Detailed Description

Primitives useful for multithreaded applications, for example, atomic counters, condition variables, and locks.

Function Documentation

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

Adds val to counter.

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).