.TH "thread.h" 3 "Sun Dec 29 2013" "GNU CommonC++" \" -*- nroff -*- .ad l .nh .SH NAME thread.h \- .PP Synchronization and threading services\&. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br .SS "Classes" .in +1c .ti -1c .RI "class \fBost::Mutex\fP" .br .RI "\fIThe \fBMutex\fP class is used to protect a section of code so that at any given time only a single thread can perform the protected operation\&. \fP" .ti -1c .RI "class \fBost::MutexLock\fP" .br .RI "\fIThe \fBMutexLock\fP class is used to protect a section of code so that at any given time only a single thread can perform the protected operation\&. \fP" .ti -1c .RI "class \fBost::ThreadLock\fP" .br .RI "\fIThe \fBThreadLock\fP 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\&. \fP" .ti -1c .RI "class \fBost::ReadLock\fP" .br .RI "\fIThe \fBReadLock\fP class is used to protect a section of code through a \fBThreadLock\fP for 'read' access to the member function\&. \fP" .ti -1c .RI "class \fBost::WriteLock\fP" .br .RI "\fIThe \fBWriteLock\fP class is used to protect a section of code through a \fBThreadLock\fP for 'write' access to the member function\&. \fP" .ti -1c .RI "class \fBost::MutexCounter\fP" .br .RI "\fIThe \fBMutex\fP \fBCounter\fP is a counter variable which can safely be incremented or decremented by multiple threads\&. \fP" .ti -1c .RI "class \fBost::AtomicCounter\fP" .br .RI "\fIThe \fBAtomicCounter\fP class offers thread-safe manipulation of an integer counter\&. \fP" .ti -1c .RI "class \fBost::Conditional\fP" .br .RI "\fIA conditional variable synchcronization object for one to one and one to many signal and control events between processes\&. \fP" .ti -1c .RI "class \fBost::Semaphore\fP" .br .RI "\fIA 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\&. \fP" .ti -1c .RI "class \fBost::SemaphoreLock\fP" .br .RI "\fIThe \fBSemaphoreLock\fP class is used to protect a section of code through a semaphore so that only x instances of the member function may execute concurrently\&. \fP" .ti -1c .RI "class \fBost::Event\fP" .br .RI "\fIThe \fBEvent\fP class implements a feature originally found in the WIN32 API; event notification\&. \fP" .ti -1c .RI "class \fBost::Thread\fP" .br .RI "\fIEvery thread of execution in an application is created by instantiating an object of a class derived from the \fBThread\fP class\&. \fP" .ti -1c .RI "class \fBost::Cancellation\fP" .br .RI "\fIA class to automatically set the thread cancellation mode of a member function\&. \fP" .ti -1c .RI "class \fBost::PosixThread\fP" .br .ti -1c .RI "class \fBost::ThreadKey\fP" .br .RI "\fIThis 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\&. \fP" .ti -1c .RI "class \fBost::TimerPort\fP" .br .RI "\fITimer ports are used to provide synchronized timing events when managed under a 'service thread' such as \fBSocketService\fP\&. \fP" .ti -1c .RI "class \fBost::SysTime\fP" .br .RI "\fIThis class is used to access non-reentrant date and time functions in the standard C library\&. \fP" .in -1c .SS "Namespaces" .in +1c .ti -1c .RI "\fBost\fP" .br .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBCCXX_POSIX\fP" .br .ti -1c .RI "#define \fBTIMEOUT_INF\fP ~((\fBtimeout_t\fP) 0)" .br .ti -1c .RI "#define \fBENTER_CRITICAL\fP enterMutex();" .br .ti -1c .RI "#define \fBLEAVE_CRITICAL\fP leaveMutex();" .br .ti -1c .RI "#define \fBENTER_DEFERRED\fP setCancel(cancelDeferred);" .br .ti -1c .RI "#define \fBLEAVE_DEFERRED\fP setCancel(cancelImmediate);" .br .ti -1c .RI "#define \fBpsleep\fP(x) (sleep)(x)" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef pthread_t \fBcctid_t\fP" .br .ti -1c .RI "typedef unsigned long \fBtimeout_t\fP" .br .ti -1c .RI "typedef int \fBost::signo_t\fP" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "struct timespec * \fBost::getTimeout\fP (struct timespec *spec, \fBtimeout_t\fP timeout)" .br .ti -1c .RI "void \fBost::wait\fP (signo_t signo)" .br .ti -1c .RI "Thread * \fBost::getThread\fP (void)" .br .ti -1c .RI "struct tm * \fBost::localtime_r\fP (const time_t *t, struct tm *b)" .br .ti -1c .RI "char * \fBost::ctime_r\fP (const time_t *t, char *buf)" .br .ti -1c .RI "struct tm * \fBost::gmtime_r\fP (const time_t *t, struct tm *b)" .br .ti -1c .RI "char * \fBost::asctime_r\fP (const struct tm *tm, char *b)" .br .in -1c .SS "Variables" .in +1c .ti -1c .RI "class \fB__EXPORT\fP \fBost::Thread\fP" .br .ti -1c .RI "class \fB__EXPORT\fP \fBost::ThreadKey\fP" .br .ti -1c .RI "class \fB__EXPORT\fP \fBost::Conditional\fP" .br .ti -1c .RI "class \fB__EXPORT\fP \fBost::Event\fP" .br .in -1c .SH "Detailed Description" .PP Synchronization and threading services\&. .SH "Macro Definition Documentation" .PP .SS "#define CCXX_POSIX" .SS "#define ENTER_CRITICAL enterMutex();" .SS "#define ENTER_DEFERRED setCancel(cancelDeferred);" .SS "#define LEAVE_CRITICAL leaveMutex();" .SS "#define LEAVE_DEFERRED setCancel(cancelImmediate);" .SS "#define psleep(x) (sleep)(x)" .SS "#define TIMEOUT_INF ~((\fBtimeout_t\fP) 0)" .SH "Typedef Documentation" .PP .SS "typedef pthread_t \fBcctid_t\fP" .SS "typedef unsigned long \fBtimeout_t\fP" .SH "Author" .PP Generated automatically by Doxygen for GNU CommonC++ from the source code\&.