My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
Thread.h File Reference
#include <iostream>
#include <pthread.h>
#include <string>
#include <unistd.h>

Go to the source code of this file.

Classes

class  gcp::util::Thread
 

Macros

#define THREAD_START(fn)   void* (fn)(void *arg)
 
#define THREAD_STOP(fn)   void (fn)(void *arg)
 
#define THREAD_CLEAN(fn)   void (fn)(void *arg)
 
#define THREAD_PING(fn)   void (fn)(void *arg)
 
#define INSTALL_MUTEX_CLEANUP(mutex, logStream)
 
#define UNINSTALL_MUTEX_CLEANUP(logStream)
 

Detailed Description

Tagged: Fri Nov 14 12:39:37 UTC 2003

Author
Erik Leitch

Macro Definition Documentation

#define INSTALL_MUTEX_CLEANUP (   mutex,
  logStream 
)
Value:
{\
int oldtype;\
if(pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype) != 0) \
logStream.appendSysError(true, "pthread_setcanceltype");\
pthread_cleanup_push(&Thread::unlockMutex, (void *) (&mutex));\
if(oldtype != PTHREAD_CANCEL_DEFERRED && oldtype != PTHREAD_CANCEL_ASYNCHRONOUS) ;\
oldtype = PTHREAD_CANCEL_ASYNCHRONOUS
#define UNINSTALL_MUTEX_CLEANUP (   logStream)
Value:
pthread_cleanup_pop(0);\
if(pthread_setcanceltype(oldtype, NULL) != 0) \
logStream.appendSysError(true, "pthread_setcanceltype");\
}