Changeset 672 for pjproject/trunk
- Timestamp:
- Aug 11, 2006 12:42:06 PM (18 years ago)
- Location:
- pjproject/trunk/pjlib/src/pj
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/log.c
r522 r672 116 116 } 117 117 if (log_decor & PJ_LOG_HAS_SENDER) { 118 enum { SENDER_WIDTH = 1 2};118 enum { SENDER_WIDTH = 14 }; 119 119 int sender_len = strlen(sender); 120 120 *pre++ = ' '; -
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r635 r672 44 44 #define THIS_FILE "os_core_unix.c" 45 45 46 #define SIGNATURE1 0xDEAFBEEF 47 #define SIGNATURE2 0xDEADC0DE 48 46 49 struct pj_thread_t 47 50 { … … 50 53 pj_thread_proc *proc; 51 54 void *arg; 55 pj_uint32_t signature1; 56 pj_uint32_t signature2; 52 57 53 58 pj_mutex_t *suspended_mutex; … … 193 198 } 194 199 195 /* If a thread descriptor has been registered before, just return it.*/200 /* Warn if this thread has been registered before */ 196 201 if (pj_thread_local_get (thread_tls_id) != 0) { 197 202 // 2006-02-26 bennylp: … … 206 211 } 207 212 213 /* On the other hand, also warn if the thread descriptor buffer seem to 214 * have been used to register other threads. 215 */ 216 pj_assert(thread->signature1 != SIGNATURE1 || 217 thread->signature2 != SIGNATURE2 || 218 (thread->thread == pthread_self())); 219 208 220 /* Initialize and set the thread entry. */ 209 221 pj_bzero(desc, sizeof(struct pj_thread_t)); 210 222 thread->thread = pthread_self(); 223 thread->signature1 = SIGNATURE1; 224 thread->signature2 = SIGNATURE2; 211 225 212 226 if(cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1) … … 218 232 219 233 rc = pj_thread_local_set(thread_tls_id, thread); 220 if (rc != PJ_SUCCESS) 234 if (rc != PJ_SUCCESS) { 235 pj_bzero(desc, sizeof(struct pj_thread_t)); 221 236 return rc; 237 } 222 238 223 239 #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
Note: See TracChangeset
for help on using the changeset viewer.