Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cf_pthread.h

Go to the documentation of this file.
00001 
00010 /* {{{ Initial comments */
00011 /*
00012  * $LastChangedDate: 2003-11-27 01:55:17 +0100 (Thu, 27 Nov 2003) $
00013  * $LastChangedRevision: 5 $
00014  * $LastChangedBy: ckruse $
00015  *
00016  */
00017 /* }}} */
00018 
00019 #ifndef _CF_PTHREAD_H
00020 #define _CF_PTHREAD_H
00021 
00022 #define CF_LM(mutex) cf_lock_mutex(__FILE__,__LINE__,(mutex))   
00023 #define CF_UM(mutex) cf_unlock_mutex(__FILE__,__LINE__,(mutex)) 
00025 #define CF_RW_RD(rwlock) cf_rwlock_rdlock(__FILE__,__LINE__,(rwlock)) 
00026 #define CF_RW_WR(rwlock) cf_rwlock_wrlock(__FILE__,__LINE__,(rwlock)) 
00027 #define CF_RW_UN(rwlock) cf_rwlock_unlock(__FILE__,__LINE__,(rwlock)) 
00032 typedef struct s_cf_mutex {
00033   u_char *name; 
00034   pthread_mutex_t mutex; 
00035 } t_cf_mutex;
00036 
00040 typedef struct s_cf_rwlock {
00041   u_char *name; 
00042   pthread_rwlock_t rwlock; 
00043 } t_cf_rwlock;
00044 
00050 void cf_mutex_init(const u_char *name,t_cf_mutex *mutex);
00051 
00055 void cf_mutex_destroy(t_cf_mutex *mutex);
00056 
00062 void cf_rwlock_init(const u_char *name,t_cf_rwlock *rwlock);
00063 
00068 void cf_rwlock_destroy(t_cf_rwlock *rwlock);
00069 
00076 void cf_lock_mutex(const u_char *file,const int line,t_cf_mutex *mutex);
00077 
00084 void cf_unlock_mutex(const u_char *file,const int line,t_cf_mutex *mutex);
00085 
00092 void cf_rwlock_rdlock(const u_char *file,const int line,t_cf_rwlock *rwlock);
00093 
00100 void cf_rwlock_wrlock(const u_char *file,const int line,t_cf_rwlock *rwlock);
00101 
00108 void cf_rwlock_unlock(const u_char *file,const int line,t_cf_rwlock *rwlock);
00109 
00110 #endif
00111 
00112 /* eof */

Generated on Sun Apr 25 16:37:36 2004 for Classic Forum by doxygen 1.3.5