inc/pthreadWrap.h

Go to the documentation of this file.
00001 /* pthreadWrap - error checking wrappers around Posix
00002  * thread functions.  Most of the errors here are invariably
00003  * fatal, but shouldn't happen unless the kernal or
00004  * the program is hosed. */
00005 
00006 #ifndef PTHREADWRAP_H
00007 #define PTHREADWRAP_H
00008 
00009 #include <pthread.h>
00010 
00011 void pthreadCreate(pthread_t *thread, const pthread_attr_t *attr,
00012         void *(*start_routine)(void *), void *arg);
00013 /* Create a thread or squawk and die. */
00014 
00015 boolean pthreadMayCreate(pthread_t *thread, const pthread_attr_t *attr,
00016         void *(*start_routine)(void *), void *arg);
00017 /* Create a thread.  Warn and return FALSE if there is a problem. */
00018 
00019 void pthreadMutexInit(pthread_mutex_t *mutex);
00020 /* Initialize mutex or die trying */
00021 
00022 void pthreadMutexDestroy(pthread_mutex_t *mutex);
00023 /* Free up mutex. */
00024 
00025 void pthreadMutexLock(pthread_mutex_t *mutex);
00026 /* Lock a mutex to gain exclusive access or die trying. */
00027 
00028 void pthreadMutexUnlock(pthread_mutex_t *mutex);
00029 /* Unlock a mutex or die trying. */
00030 
00031 void pthreadCondInit(pthread_cond_t *cond);
00032 /* Initialize pthread conditional. */
00033 
00034 void pthreadCondDestroy(pthread_cond_t *cond);
00035 /* Free up conditional. */
00036 
00037 void pthreadCondSignal(pthread_cond_t *cond);
00038 /* Set conditional signal to wake up a sleeping thread, or
00039  * die trying. */
00040 
00041 void pthreadCondWait(pthread_cond_t *cond, pthread_mutex_t *mutex);
00042 /* Wait for conditional signal. */
00043 
00044 #endif /* PTHREADWRAP_H */
00045 

Generated on Tue Dec 25 18:39:29 2007 for blat by  doxygen 1.5.2