Changeset 675
- Timestamp:
- Aug 12, 2006 1:58:56 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r674 r675 80 80 int nesting_level; 81 81 pj_thread_t *owner; 82 char owner_name[PJ_MAX_OBJ_NAME]; 82 83 #endif 83 84 }; … … 979 980 PJ_ASSERT_RETURN(mutex, PJ_EINVAL); 980 981 982 #if PJ_DEBUG 983 PJ_LOG(6,(mutex->obj_name, "Mutex: thread %s is waiting (mutex owner=%s)", 984 pj_thread_this()->obj_name, 985 mutex->owner_name)); 986 #else 981 987 PJ_LOG(6,(mutex->obj_name, "Mutex: thread %s is waiting", 982 988 pj_thread_this()->obj_name)); 989 #endif 983 990 984 991 status = pthread_mutex_lock( &mutex->mutex ); 985 992 993 994 #if PJ_DEBUG 995 if (status == PJ_SUCCESS) { 996 mutex->owner = pj_thread_this(); 997 pj_ansi_strcpy(mutex->owner_name, mutex->owner->obj_name); 998 ++mutex->nesting_level; 999 } 1000 1001 PJ_LOG(6,(mutex->obj_name, 1002 (status==0 ? 1003 "Mutex acquired by thread %s (level=%d)" : 1004 "Mutex acquisition FAILED by %s (level=%d)"), 1005 pj_thread_this()->obj_name, 1006 mutex->nesting_level)); 1007 #else 986 1008 PJ_LOG(6,(mutex->obj_name, 987 1009 (status==0 ? "Mutex acquired by thread %s" : "FAILED by %s"), 988 1010 pj_thread_this()->obj_name)); 989 990 #if PJ_DEBUG991 if (status == PJ_SUCCESS) {992 mutex->owner = pj_thread_this();993 ++mutex->nesting_level;994 }995 1011 #endif 996 1012 … … 1020 1036 if (--mutex->nesting_level == 0) { 1021 1037 mutex->owner = NULL; 1022 } 1023 #endif 1024 1038 mutex->owner_name[0] = '\0'; 1039 } 1040 1041 PJ_LOG(6,(mutex->obj_name, "Mutex released by thread %s (level=%d)", 1042 pj_thread_this()->obj_name, 1043 mutex->nesting_level)); 1044 #else 1025 1045 PJ_LOG(6,(mutex->obj_name, "Mutex released by thread %s", 1026 1046 pj_thread_this()->obj_name)); 1047 #endif 1027 1048 1028 1049 status = pthread_mutex_unlock( &mutex->mutex ); … … 1052 1073 1053 1074 if (status==0) { 1075 #if PJ_DEBUG 1076 mutex->owner = pj_thread_this(); 1077 pj_ansi_strcpy(mutex->owner_name, mutex->owner->obj_name); 1078 ++mutex->nesting_level; 1079 1080 PJ_LOG(6,(mutex->obj_name, "Mutex acquired by thread %s (level=%d)", 1081 pj_thread_this()->obj_name, 1082 mutex->nesting_level)); 1083 #else 1054 1084 PJ_LOG(6,(mutex->obj_name, "Mutex acquired by thread %s", 1055 1085 pj_thread_this()->obj_name)); 1056 1057 #if PJ_DEBUG1058 mutex->owner = pj_thread_this();1059 ++mutex->nesting_level;1060 1086 #endif 1061 1087 } … … 1082 1108 1083 1109 #if PJ_HAS_THREADS 1084 PJ_LOG(6,(mutex->obj_name, "Mutex destroyed")); 1110 PJ_LOG(6,(mutex->obj_name, "Mutex destroyed by thread %s", 1111 pj_thread_this()->obj_name)); 1085 1112 status = pthread_mutex_destroy( &mutex->mutex ); 1086 1113 if (status == 0) -
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r673 r675 81 81 pj_list_init(&dlg->inv_hdr); 82 82 83 status = pj_mutex_create_recursive(pool, "dlg%p", &dlg->mutex_);83 status = pj_mutex_create_recursive(pool, dlg->obj_name, &dlg->mutex_); 84 84 if (status != PJ_SUCCESS) 85 85 goto on_error; -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r657 r675 906 906 tsx->timeout_timer.cb = &tsx_timer_callback; 907 907 908 status = pj_mutex_create_recursive(pool, "tsx%p", &tsx->mutex);908 status = pj_mutex_create_recursive(pool, tsx->obj_name, &tsx->mutex); 909 909 if (status != PJ_SUCCESS) { 910 910 pjsip_endpt_release_pool(mod_tsx_layer.endpt, pool);
Note: See TracChangeset
for help on using the changeset viewer.