14 #pragma message ( "warning: Thread notes are on... (see pz_pthread.h)" ) 16 int pz_pthread_create(pthread_t *thread,
const pthread_attr_t *attr,
void 17 *(*start_routine)(
void *),
void *arg,
const char*
fn,
18 const char* file,
unsigned line);
20 int pz_pthread_join(pthread_t thread,
void **value_ptr,
21 const char*
fn,
const char* file,
unsigned line);
23 #define PZ_PTHREAD_CREATE(thread,attr,routine,args,fn) \ 24 pz_pthread_create(thread,attr,routine,args,fn,__FILE__,__LINE__) 26 #define PZ_PTHREAD_JOIN(thread,val,fn) \ 27 pz_pthread_join(thread,val,fn,__FILE__,__LINE__) 31 #define PZ_PTHREAD_CREATE(thread,attr,routine,args,fn) \ 32 pthread_create(thread,attr,routine,args) 34 #define PZ_PTHREAD_JOIN(thread,val,fn) \ 35 pthread_join(thread,val) 39 #ifdef THREAD_MUTEX_NOTES 41 #pragma message ( "warning: Thread mutex notes are on... (see pz_pthread.h)" ) 43 int pz_pthread_mutex_init(pthread_mutex_t*
mutex,
const pthread_mutexattr_t* attr,
44 const char*
fn,
const char* file,
unsigned line);
45 int pz_pthread_mutex_destroy(pthread_mutex_t *
mutex,
46 const char*
fn,
const char* file,
unsigned line);
47 int pz_pthread_mutex_lock(pthread_mutex_t *
mutex,
48 const char*
fn,
const char* file,
unsigned line);
49 int pz_pthread_mutex_unlock(pthread_mutex_t *
mutex,
50 const char*
fn,
const char* file,
unsigned line);
56 #define PZ_PTHREAD_MUTEX_INIT(mutex,attr,fn) \ 57 pz_pthread_mutex_init(mutex,attr,fn,__FILE__,__LINE__) 59 #define PZ_PTHREAD_MUTEX_DESTROY(mutex,fn) \ 60 pz_pthread_mutex_destroy(mutex,fn,__FILE__,__LINE__) 62 #define PZ_PTHREAD_MUTEX_LOCK(mutex,fn) \ 63 pz_pthread_mutex_lock(mutex,fn,__FILE__,__LINE__) 65 #define PZ_PTHREAD_MUTEX_UNLOCK(mutex,fn) \ 66 pz_pthread_mutex_unlock(mutex,fn,__FILE__,__LINE__) 70 #define PZ_PTHREAD_MUTEX_INIT(mutex,attr,fn) \ 71 pthread_mutex_init(mutex,attr) 73 #define PZ_PTHREAD_MUTEX_DESTROY(mutex,fn) \ 74 pthread_mutex_destroy(mutex) 76 #define PZ_PTHREAD_MUTEX_LOCK(mutex,fn) \ 77 pthread_mutex_lock(mutex) 79 #define PZ_PTHREAD_MUTEX_UNLOCK(mutex,fn) \ 80 pthread_mutex_unlock(mutex) 85 #ifdef THREAD_COND_NOTES 87 #pragma message ( "warning: Thread cond notes are on... (see pz_pthread.h)" ) 89 int pz_pthread_cond_init(pthread_cond_t*
cond,
const pthread_condattr_t* attr,
90 const char*
fn,
const char* file,
unsigned line);
92 int pz_pthread_cond_destroy(pthread_cond_t *
cond,
93 const char*
fn,
const char* file,
unsigned line);
95 int pz_pthread_cond_wait(pthread_cond_t*
cond, pthread_mutex_t*
mutex,
96 const char*
fn,
const char* file,
unsigned line);
98 int pz_pthread_cond_broadcast(pthread_cond_t *
cond,
99 const char*
fn,
const char* file,
unsigned line);
101 int pz_pthread_cond_signal(pthread_cond_t *
cond,
102 const char*
fn,
const char* file,
unsigned line);
104 #define PZ_PTHREAD_COND_INIT(cond,attr,fn) \ 105 pz_pthread_cond_init(cond,attr,fn,__FILE__,__LINE__) 107 #define PZ_PTHREAD_COND_DESTROY(cond,fn) \ 108 pz_pthread_cond_destroy(cond,fn,__FILE__,__LINE__) 110 #define PZ_PTHREAD_COND_WAIT(cond,mutex,fn) \ 111 pz_pthread_cond_wait(cond,mutex,fn,__FILE__,__LINE__) 113 #define PZ_PTHREAD_COND_SIGNAL(cond,fn) \ 114 pz_pthread_cond_signal(cond,fn,__FILE__,__LINE__) 116 #define PZ_PTHREAD_COND_BROADCAST(cond,fn) \ 117 pz_pthread_cond_broadcast(cond,fn,__FILE__,__LINE__) 121 #define PZ_PTHREAD_COND_INIT(cond,attr,fn) \ 122 pthread_cond_init(cond,attr) 124 #define PZ_PTHREAD_COND_DESTROY(cond,fn) \ 125 pthread_cond_destroy(cond) 127 #define PZ_PTHREAD_COND_WAIT(cond,mutex,fn) \ 128 pthread_cond_wait(cond,mutex) 130 #define PZ_PTHREAD_COND_SIGNAL(cond,fn) \ 131 pthread_cond_signal(cond) 133 #define PZ_PTHREAD_COND_BROADCAST(cond,fn) \ 134 pthread_cond_broadcast(cond) 143 #endif // PZ_PTHREAD_H pthread_mutex_t mutex
Semaphore which controls multiple threads.
void pz_pthread_log_stop()
void pz_pthread_log_report(std::ostream &o)
void pz_pthread_log_start()