Changeset 320
- Timestamp:
- Mar 15, 2011, 8:59:48 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 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) -
trunk/src/sh_hash.c
r307 r320 1554 1554 1555 1555 SL_ENTER(_("sh_hash_hashdelete")); 1556 SH_MUTEX_LOCK(mutex_hash); 1556 1557 /* need deadlock detection here if called from exit handler 1558 */ 1559 SH_MUTEX_TRYLOCK(mutex_hash); 1557 1560 1558 1561 if (IsInit == 0) … … 1570 1573 ; /* 'label at end of compound statement */ 1571 1574 SH_MUTEX_UNLOCK(mutex_hash); 1575 1572 1576 SL_RET0(_("sh_hash_hashdelete")); 1573 1577 }
Note:
See TracChangeset
for help on using the changeset viewer.