Changes in pjproject/main/pjlib/src/pj/os_core_win32.c [1:3]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/main/pjlib/src/pj/os_core_win32.c
- Property svn:keywords set to Author
r1 r3 1 /* $Header: /pjproject-0.3/pjlib/src/pj/os_core_win32.c 12 10/29/05 11:51a Bennylp $ */ 2 /* $Log: /pjproject-0.3/pjlib/src/pj/os_core_win32.c $ 3 * 4 * 12 10/29/05 11:51a Bennylp 5 * Version 0.3-pre2. 6 * 7 * 11 10/14/05 12:26a Bennylp 8 * Finished error code framework, some fixes in ioqueue, etc. Pretty 9 * major. 10 * 11 * 10 9/21/05 1:39p Bennylp 12 * Periodic checkin for backup. 13 * 14 * 9 9/17/05 10:37a Bennylp 15 * Major reorganization towards version 0.3. 16 * 1 /* $Id$ 2 * 17 3 */ 18 4 #include <pj/os.h> … … 192 178 { 193 179 char stack_ptr; 180 pj_status_t rc; 194 181 pj_thread_t *thread = (pj_thread_t *)desc; 195 182 pj_str_t thread_name = pj_str((char*)cstr_thread_name); … … 208 195 209 196 /* Initialize and set the thread entry. */ 210 pj_memset(desc, 0, sizeof( pj_thread_desc));197 pj_memset(desc, 0, sizeof(struct pj_thread_t)); 211 198 thread->hthread = GetCurrentThread(); 212 199 thread->idthread = GetCurrentThreadId(); … … 225 212 pj_sprintf(thread->obj_name, "thr%p", (void*)thread->idthread); 226 213 227 pj_thread_local_set(thread_tls_id, thread); 214 rc = pj_thread_local_set(thread_tls_id, thread); 215 if (rc != PJ_SUCCESS) 216 return rc; 228 217 229 218 *thread_ptr = thread; … … 257 246 PJ_LOG(6,(rec->obj_name, "Thread started")); 258 247 259 pj_thread_local_set(thread_tls_id, rec); 248 if (pj_thread_local_set(thread_tls_id, rec) != PJ_SUCCESS) { 249 pj_assert(!"TLS is not set (pj_init() error?)"); 250 } 251 260 252 result = (*rec->proc)(rec->arg); 261 253 … … 586 578 * pj_thread_local_set() 587 579 */ 588 PJ_DEF(void) pj_thread_local_set(long index, void *value) 589 { 580 PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value) 581 { 582 BOOL rc; 583 590 584 //Can't check stack because this function is called in the 591 585 //beginning before main thread is initialized. 592 586 //PJ_CHECK_STACK(); 593 TlsSetValue(index, value); 587 rc = TlsSetValue(index, value); 588 return rc!=0 ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(GetLastError()); 594 589 } 595 590
Note: See TracChangeset
for help on using the changeset viewer.