Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

thread File Reference


Detailed Description

Threads of execution, locking, and conditions.

#include <NMSTL/internal.h>
#include <NMSTL/ntime>
#include <NMSTL/debug>
#include <pthread.h>
#include <cerrno>
#include <cassert>
#include <iostream>

Compounds

class  Condition
 A Condition variable. More...

class  Guard
 A class which acquires a lock on creating and destroys it on destruction. More...

class  Mutex
 A non-recusive mutual-exclusion lock. More...

class  Thread
 A Thread of control. More...

class  Threaded
 A Thread of control for an object with a run() method. More...


Defines

#define locking(m)   if (Guard<> __nmstl_guard = m) { while(true) ; } else
 A control structure which acquires a lock at the beginning of a block and releases it whenever the block exits.

#define locking_T(m, T)   if (Guard<T> __nmstl_guard = m) { while(true) ; } else
 Similar to locking(m), but usable for arbitrarily-typed locks.


Functions

 NMSTL_TO_STRING_INTL (Thread)

Variables

 NMSTL_NAMESPACE_BEGIN
 NMSTL_NAMESPACE_END


Define Documentation

#define locking      if (Guard<> __nmstl_guard = m) { while(true) ; } else
 

A control structure which acquires a lock at the beginning of a block and releases it whenever the block exits.

It is typically used like so:

 Mutex my_mutex;

 int my_function()
 {
     locking (Mutex) {
         do_some_exclusive_stuff();
         if (some_condition())
             return 1;
         do_other_stuff();
     }

     return 0;
 }

#define locking_T m,
     if (Guard<T> __nmstl_guard = m) { while(true) ; } else
 

Similar to locking(m), but usable for arbitrarily-typed locks.


Function Documentation

NMSTL_TO_STRING_INTL Thread   
 


Variable Documentation

NMSTL_NAMESPACE_BEGIN
 

NMSTL_NAMESPACE_END
 


Generated on Fri Dec 20 13:35:11 2002 for NMSTL