Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Wefts Namespace Reference

The Wefts++ namespace. More...


Compounds

class  Barrier
 Programmable fence object. More...

class  Cond
 Class implementing a condition variable. More...

class  Counter
 Syncrhonizable counter. More...

class  FastCondition
 Fast mutex + condition structure wrapper. More...

class  MoaningThread
 A thread subclass supporting an arbitrary number of joiners. More...

class  Mutex
 Implements a very fast, non reentrant mutex. More...

class  RCondition
 Reentrant mutex + condition structure wrapper. More...

class  Referenced
 Shared object between threads implementing reference count and self-cancelation. More...

class  RMutex
 This is a reentrant mutex with spinlock. More...

class  RRWMutex
 This is an advanced (and fully reentrant) read/write mutex. More...

class  RWMutex
 This is a read/write mutex. More...

class  Subscription
 subscribe/notify model abstraction. More...

class  Thread
 Implements the abstraction of a thread. More...


Functions

bool Sleep (long seconds, long nanoseconds)
 Sleeps a certain amount of time.

bool Sleep (double seconds)
 Sleeps a certain amount of time.

void s_ThreadCleanupper (void *param)
 Function used (internally) to invoke thread->cleanup() in case of cancelation.

void * s_ThreadRunFunc (void *param)
 Function used (internally) to invoke thread->run().

Counter runningThreads (1)
 Counter of currently active (or near-to-be active) threads.

Counter startedThreads (1)
 Incremental counter of started threads.


Variables

Counter runningThreads
 Counter of currently active (or near-to-be active) threads.

Counter startedThreads
 Incremental counter of started threads.


Detailed Description

The Wefts++ namespace.

All the wefts classes and functions are available under Wefts namespce; they are rather thread specific, so if you are using Wefts++ alone, without any other threading library, you will be pretty safe in adding:

   #include <wefts.h>

   using namespace Wefts;

Otherwise, you will have to prefix all Wefts++ calls with the namespace:

   #include <wefts.h>

   int main( int argc, char *argv[] )
   {
      //sleeping a while..
      Wefts::Sleep( 1.5 );
   }


Function Documentation

Counter runningThreads  
 

Counter of currently active (or near-to-be active) threads.

Initialized to 1: if we initialized it, the main thread is running...

void s_ThreadCleanupper void *    param
 

Function used (internally) to invoke thread->cleanup() in case of cancelation.

void* s_ThreadRunFunc void *    param
 

Function used (internally) to invoke thread->run().

bool Wefts::Sleep double    seconds
 

Sleeps a certain amount of time.

Sleeps for a given amount of seconds (1.0 meaning one second, 0.5 half second and so on). The process calling this function will be awaken as soon as possible as the time is elapsed; this could also result in a noticeable delay. Also, it is possible that the process is awaken before the wait is elapsed; this may happen if a signal is issued to the process that is currently helding waiting threads.

Note:
Even if you use the command using namespace Wefts, this function won't clash with MS-Windows API Sleep(), as their prototype are different. Just remember that if you want to invoke Wefts::Sleep(), you have to use double parameter, that is dotted numbers as 1.0, never 1.
Parameters:
seconds  the wait time in seconds and second fractions.
Returns:
true if wait has elapsed without interruption, false otherwise.

bool Wefts::Sleep long    seconds,
long    nanoseconds
 

Sleeps a certain amount of time.

Sleeps for a given amount of seconds (that may be also 0), and of nanoseconds (up to 999,999,999, almost one second). The process calling this function will be awaken as soon as possible as the time is elapsed; this could also result in a noticeable delay. Also, it is possible that the process is awaken before the wait is elapsed; this may happen if a signal is issued to the process that is currently helding waiting threads.

Parameters:
seconds  the wait time in whole seconds (may be 0)
nanoseconds  wait time in nanoseconds ( up to one second).
Returns:
true if wait has elapsed without interruption, false otherwise.

Counter startedThreads  
 

Incremental counter of started threads.

It is used just in internal thread ID count for debugging or reporting purposes


Variable Documentation

Counter Wefts::runningThreads( 1 )
 

Counter of currently active (or near-to-be active) threads.

Initialized to 1: if we initialized it, the main thread is running...

Counter Wefts::startedThreads( 1 )
 

Incremental counter of started threads.

It is used just in internal thread ID count for debugging or reporting purposes


Generated on Tue Aug 5 18:09:02 2003 for Wefts by doxygen1.2.18