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:10 2002 for NMSTL