design_pattern_for_c  V 1.00
dp_mutex.h
Go to the documentation of this file.
1 
5 #ifndef DPUTIL_MUTEX_H_
6 #define DPUTIL_MUTEX_H_
7 
8 #include <pthread.h>
9 /* @{ */
11 void dputil_lock(void *handle);
13 void dputil_unlock(void *handle);
15 #define DPUTIL_LOCK(lock) \
16  dputil_lock(lock);\
17  pthread_cleanup_push(dputil_unlock, lock);
18 
19 #define DPUTIL_UNLOCK pthread_cleanup_pop(1);
20 /* @} */
21 #endif
void dputil_unlock(void *handle)
unlock
Definition: dp_util.c:14
void dputil_lock(void *handle)
lock
Definition: dp_util.c:7
void * handle
Definition: event_thread.c:30