Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
thread.h File Reference

Synchronization and threading services. More...

#include <cc++/config.h>
#include <cc++/string.h>
#include <ctime>
#include <pthread.h>
#include <time.h>
#include <signal.h>
#include <unistd.h>
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  Mutex
 The Mutex class is used to protect a section of code so that at any given time only a single thread can perform the protected operation. More...
 
class  MutexLock
 The MutexLock class is used to protect a section of code so that at any given time only a single thread can perform the protected operation. More...
 
class  ThreadLock
 The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have rwlock support, and reverts to a simple mutex for those that do not. More...
 
class  ReadLock
 The ReadLock class is used to protect a section of code through a ThreadLock for "read" access to the member function. More...
 
class  WriteLock
 The WriteLock class is used to protect a section of code through a ThreadLock for "write" access to the member function. More...
 
class  MutexCounter
 The Mutex Counter is a counter variable which can safely be incremented or decremented by multiple threads. More...
 
class  AtomicCounter
 The AtomicCounter class offers thread-safe manipulation of an integer counter. More...
 
class  Conditional
 A conditional variable synchcronization object for one to one and one to many signal and control events between processes. More...
 
class  Semaphore
 A semaphore is generally used as a synchronization object between multiple threads or to protect a limited and finite resource such as a memory or thread pool. More...
 
class  SemaphoreLock
 The SemaphoreLock class is used to protect a section of code through a semaphore so that only x instances of the member function may execute concurrently. More...
 
class  Event
 The Event class implements a feature originally found in the WIN32 API; event notification. More...
 
class  Thread
 Every thread of execution in an application is created by instantiating an object of a class derived from the Thread class. More...
 
class  Cancellation
 A class to automatically set the thread cancellation mode of a member function. More...
 
class  PosixThread
 
class  ThreadKey
 This class allows the creation of a thread context unique "pointer" that can be set and retrieved and can be used to create thread specific data areas for implementing "thread safe" library routines. More...
 
class  TimerPort
 Timer ports are used to provide synchronized timing events when managed under a "service thread" such as SocketService. More...
 
class  SysTime
 This class is used to access non-reentrant date and time functions in the standard C library. More...
 

Macros

#define CCXX_POSIX
 
#define TIMEOUT_INF   ~((timeout_t) 0)
 
#define ENTER_CRITICAL   enterMutex();
 
#define LEAVE_CRITICAL   leaveMutex();
 
#define ENTER_DEFERRED   setCancel(cancelDeferred);
 
#define LEAVE_DEFERRED   setCancel(cancelImmediate);
 
#define psleep(x)   (sleep)(x)
 

Typedefs

typedef pthread_t cctid_t
 
typedef unsigned long timeout_t
 
typedef int signo_t
 

Functions

struct timespec * getTimeout (struct timespec *spec, timeout_t timeout)
 
void wait (signo_t signo)
 
ThreadgetThread (void)
 
struct tm * localtime_r (const time_t *t, struct tm *b)
 
char * ctime_r (const time_t *t, char *buf)
 
struct tm * gmtime_r (const time_t *t, struct tm *b)
 
char * asctime_r (const struct tm *tm, char *b)
 

Variables

class __EXPORT Thread
 
class __EXPORT ThreadKey
 
class __EXPORT Conditional
 
class __EXPORT Event
 

Detailed Description

Synchronization and threading services.

Definition in file thread.h.

Macro Definition Documentation

#define CCXX_POSIX

Definition at line 54 of file thread.h.

#define ENTER_CRITICAL   enterMutex();

Definition at line 117 of file thread.h.

#define ENTER_DEFERRED   setCancel(cancelDeferred);

Definition at line 119 of file thread.h.

#define LEAVE_CRITICAL   leaveMutex();

Definition at line 118 of file thread.h.

#define LEAVE_DEFERRED   setCancel(cancelImmediate);

Definition at line 120 of file thread.h.

#define psleep (   x)    (sleep)(x)

Definition at line 130 of file thread.h.

#define TIMEOUT_INF   ~((timeout_t) 0)

Definition at line 115 of file thread.h.

Typedef Documentation

typedef pthread_t cctid_t

Definition at line 73 of file thread.h.

typedef int signo_t

Definition at line 1535 of file thread.h.

typedef unsigned long timeout_t

Definition at line 74 of file thread.h.

Function Documentation

char* asctime_r ( const struct tm *  tm,
char *  b 
)
inline

Definition at line 1970 of file thread.h.

char* ctime_r ( const time_t *  t,
char *  buf 
)
inline

Definition at line 1966 of file thread.h.

Thread* getThread ( void  )
inline

Definition at line 1900 of file thread.h.

struct timespec* getTimeout ( struct timespec *  spec,
timeout_t  timeout 
)
struct tm* gmtime_r ( const time_t *  t,
struct tm *  b 
)

Definition at line 1968 of file thread.h.

struct tm* localtime_r ( const time_t *  t,
struct tm *  b 
)

Definition at line 1964 of file thread.h.

void wait ( signo_t  signo)

Variable Documentation

Definition at line 140 of file thread.h.

class __EXPORT Event

Definition at line 141 of file thread.h.

Definition at line 112 of file thread.h.

Definition at line 113 of file thread.h.