Changeset 320 for trunk/include/sh_pthread.h
- Timestamp:
- Mar 15, 2011, 8:59:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/sh_pthread.h
r315 r320 23 23 do { \ 24 24 int oldtype; \ 25 int executeStack = 1; \ 25 26 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); \ 26 27 pthread_cleanup_push(sh_pthread_mutex_unlock, (void*)&(M));\ 27 28 pthread_mutex_lock(&(M)) 28 29 30 #define SH_MUTEX_TRYLOCK(M) \ 31 do { \ 32 int oldtype; \ 33 int executeStack = 0; \ 34 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); \ 35 pthread_cleanup_push(sh_pthread_mutex_unlock, (void*)&(M));\ 36 pthread_mutex_trylock(&(M)); \ 37 executeStack = 1 29 38 30 39 #define SH_MUTEX_UNLOCK(M) \ 31 pthread_cleanup_pop( 1);\40 pthread_cleanup_pop(executeStack); \ 32 41 pthread_setcanceltype(oldtype, NULL); \ 33 42 } while (0) … … 147 156 #define SH_MUTEX_EXTERN(M) extern void *SH_MUTEX_DUMMY_ ## M 148 157 #define SH_MUTEX_LOCK(M) ((void)0) 158 #define SH_MUTEX_TRYLOCK(M) ((void)0) 149 159 #define SH_MUTEX_UNLOCK(M) ((void)0) 150 160 #define SH_MUTEX_LOCK_UNSAFE(M) ((void)0)
Note:
See TracChangeset
for help on using the changeset viewer.