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

cf_pthread.h File Reference

Pthread function and datatype wrappers. More...

Go to the source code of this file.

Data Structures

struct  s_cf_mutex
struct  s_cf_rwlock

Defines

#define CF_LM(mutex)   cf_lock_mutex(__FILE__,__LINE__,(mutex))
#define CF_UM(mutex)   cf_unlock_mutex(__FILE__,__LINE__,(mutex))
#define CF_RW_RD(rwlock)   cf_rwlock_rdlock(__FILE__,__LINE__,(rwlock))
#define CF_RW_WR(rwlock)   cf_rwlock_wrlock(__FILE__,__LINE__,(rwlock))
#define CF_RW_UN(rwlock)   cf_rwlock_unlock(__FILE__,__LINE__,(rwlock))

Typedefs

typedef s_cf_mutex t_cf_mutex
typedef s_cf_rwlock t_cf_rwlock

Functions

void cf_mutex_init (const u_char *name, t_cf_mutex *mutex)
void cf_mutex_destroy (t_cf_mutex *mutex)
void cf_rwlock_init (const u_char *name, t_cf_rwlock *rwlock)
void cf_rwlock_destroy (t_cf_rwlock *rwlock)
void cf_lock_mutex (const u_char *file, const int line, t_cf_mutex *mutex)
void cf_unlock_mutex (const u_char *file, const int line, t_cf_mutex *mutex)
void cf_rwlock_rdlock (const u_char *file, const int line, t_cf_rwlock *rwlock)
void cf_rwlock_wrlock (const u_char *file, const int line, t_cf_rwlock *rwlock)
void cf_rwlock_unlock (const u_char *file, const int line, t_cf_rwlock *rwlock)


Detailed Description

Pthread function and datatype wrappers.

Author:
Christian Kruse, <cjk@wwwtech.de>
This file contains some datatypes to debug pthread locking functions

Definition in file cf_pthread.h.


Define Documentation

#define CF_LM mutex   )     cf_lock_mutex(__FILE__,__LINE__,(mutex))
 

Lock a mutex

Definition at line 22 of file cf_pthread.h.

#define CF_RW_RD rwlock   )     cf_rwlock_rdlock(__FILE__,__LINE__,(rwlock))
 

Lock a rwlock shared

Definition at line 25 of file cf_pthread.h.

#define CF_RW_UN rwlock   )     cf_rwlock_unlock(__FILE__,__LINE__,(rwlock))
 

Unlock a rwlock

Definition at line 27 of file cf_pthread.h.

#define CF_RW_WR rwlock   )     cf_rwlock_wrlock(__FILE__,__LINE__,(rwlock))
 

Lock a rwlock writable

Definition at line 26 of file cf_pthread.h.

#define CF_UM mutex   )     cf_unlock_mutex(__FILE__,__LINE__,(mutex))
 

Unlock a mutex

Definition at line 23 of file cf_pthread.h.


Typedef Documentation

typedef struct s_cf_mutex t_cf_mutex
 

This struct is used to store a mutex and it's name

typedef struct s_cf_rwlock t_cf_rwlock
 

This struct is used to store a rwlock and it's name


Function Documentation

void cf_lock_mutex const u_char *  file,
const int  line,
t_cf_mutex mutex
 

This function locks a mutex

Parameters:
file The file name
line The line number
mutex The mutex object

Definition at line 58 of file cf_pthread.c.

void cf_mutex_destroy t_cf_mutex mutex  ) 
 

The destructor for the t_cf_mutex class

Definition at line 44 of file cf_pthread.c.

void cf_mutex_init const u_char *  name,
t_cf_mutex mutex
 

Initialization function for the t_cf_mutex

Parameters:
name The name of the mutex
mutex The t_cf_mutex object

Definition at line 40 of file cf_pthread.c.

void cf_rwlock_destroy t_cf_rwlock rwlock  ) 
 

This function is the destructor for the read-write lock class

Parameters:
rwlock The read-write lock object

Definition at line 53 of file cf_pthread.c.

void cf_rwlock_init const u_char *  name,
t_cf_rwlock rwlock
 

This function initializes a rwlock

Parameters:
name The name of the read-write lock
rwlock The read-write lock object

Definition at line 49 of file cf_pthread.c.

void cf_rwlock_rdlock const u_char *  file,
const int  line,
t_cf_rwlock rwlock
 

This function locks a rwlock shared

Parameters:
file The file name
line The line number
rwlock The read-write lock

Definition at line 125 of file cf_pthread.c.

void cf_rwlock_unlock const u_char *  file,
const int  line,
t_cf_rwlock rwlock
 

This function unlocks a read-write lock

Parameters:
file The file name
line The line number
rwlock The read-write lock

Definition at line 191 of file cf_pthread.c.

void cf_rwlock_wrlock const u_char *  file,
const int  line,
t_cf_rwlock rwlock
 

This function locks a read-write lock writable

Parameters:
file The file name
line The line number
rwlock The read-write lock

Definition at line 158 of file cf_pthread.c.

void cf_unlock_mutex const u_char *  file,
const int  line,
t_cf_mutex mutex
 

This function unlocks a mutex

Parameters:
file The file name
line The line number
mutex The mutex object

Definition at line 92 of file cf_pthread.c.


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