Changeset 708 for pjproject/trunk
- Timestamp:
- Sep 12, 2006 11:49:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r675 r708 1102 1102 PJ_DEF(pj_status_t) pj_mutex_destroy(pj_mutex_t *mutex) 1103 1103 { 1104 enum { RETRY = 4 }; 1104 1105 int status; 1106 unsigned retry; 1105 1107 1106 1108 PJ_CHECK_STACK(); … … 1110 1112 PJ_LOG(6,(mutex->obj_name, "Mutex destroyed by thread %s", 1111 1113 pj_thread_this()->obj_name)); 1112 status = pthread_mutex_destroy( &mutex->mutex ); 1114 1115 for (retry=0; retry<RETRY; ++retry) { 1116 status = pthread_mutex_destroy( &mutex->mutex ); 1117 if (status == PJ_SUCCESS) 1118 break; 1119 else if (retry<RETRY-1 && status == EBUSY) 1120 pthread_mutex_unlock(&mutex->mutex); 1121 } 1122 1113 1123 if (status == 0) 1114 1124 return PJ_SUCCESS; 1115 else 1125 else { 1126 pj_assert(!"Error destroying pthread_mutex"); 1116 1127 return PJ_RETURN_OS_ERROR(status); 1128 } 1117 1129 #else 1118 1130 pj_assert( mutex == (pj_mutex_t*)1 );
Note: See TracChangeset
for help on using the changeset viewer.