Changeset 2 for pjproject/main/pjlib/src/pj/os_core_win32.c
- Timestamp:
- Nov 1, 2005 4:42:51 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/main/pjlib/src/pj/os_core_win32.c
r1 r2 192 192 { 193 193 char stack_ptr; 194 pj_status_t rc; 194 195 pj_thread_t *thread = (pj_thread_t *)desc; 195 196 pj_str_t thread_name = pj_str((char*)cstr_thread_name); … … 208 209 209 210 /* Initialize and set the thread entry. */ 210 pj_memset(desc, 0, sizeof( pj_thread_desc));211 pj_memset(desc, 0, sizeof(struct pj_thread_t)); 211 212 thread->hthread = GetCurrentThread(); 212 213 thread->idthread = GetCurrentThreadId(); … … 225 226 pj_sprintf(thread->obj_name, "thr%p", (void*)thread->idthread); 226 227 227 pj_thread_local_set(thread_tls_id, thread); 228 rc = pj_thread_local_set(thread_tls_id, thread); 229 if (rc != PJ_SUCCESS) 230 return rc; 228 231 229 232 *thread_ptr = thread; … … 257 260 PJ_LOG(6,(rec->obj_name, "Thread started")); 258 261 259 pj_thread_local_set(thread_tls_id, rec); 262 if (pj_thread_local_set(thread_tls_id, rec) != PJ_SUCCESS) { 263 pj_assert(!"TLS is not set (pj_init() error?)"); 264 } 265 260 266 result = (*rec->proc)(rec->arg); 261 267 … … 586 592 * pj_thread_local_set() 587 593 */ 588 PJ_DEF(void) pj_thread_local_set(long index, void *value) 589 { 594 PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value) 595 { 596 BOOL rc; 597 590 598 //Can't check stack because this function is called in the 591 599 //beginning before main thread is initialized. 592 600 //PJ_CHECK_STACK(); 593 TlsSetValue(index, value); 601 rc = TlsSetValue(index, value); 602 return rc!=0 ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(GetLastError()); 594 603 } 595 604
Note: See TracChangeset
for help on using the changeset viewer.