Ignore:
Timestamp:
Nov 1, 2005 4:42:51 PM (19 years ago)
Author:
bennylp
Message:

Added suppor /and fix things for SunOS port

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/main/pjlib/src/pj/os_core_win32.c

    r1 r2  
    192192{ 
    193193    char stack_ptr; 
     194    pj_status_t rc; 
    194195    pj_thread_t *thread = (pj_thread_t *)desc; 
    195196    pj_str_t thread_name = pj_str((char*)cstr_thread_name); 
     
    208209 
    209210    /* 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)); 
    211212    thread->hthread = GetCurrentThread(); 
    212213    thread->idthread = GetCurrentThreadId(); 
     
    225226        pj_sprintf(thread->obj_name, "thr%p", (void*)thread->idthread); 
    226227     
    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; 
    228231 
    229232    *thread_ptr = thread; 
     
    257260    PJ_LOG(6,(rec->obj_name, "Thread started")); 
    258261 
    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 
    260266    result = (*rec->proc)(rec->arg); 
    261267 
     
    586592 * pj_thread_local_set() 
    587593 */ 
    588 PJ_DEF(void) pj_thread_local_set(long index, void *value) 
    589 { 
     594PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value) 
     595{ 
     596    BOOL rc; 
     597 
    590598    //Can't check stack because this function is called in the 
    591599    //beginning before main thread is initialized. 
    592600    //PJ_CHECK_STACK(); 
    593     TlsSetValue(index, value); 
     601    rc = TlsSetValue(index, value); 
     602    return rc!=0 ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(GetLastError()); 
    594603} 
    595604 
Note: See TracChangeset for help on using the changeset viewer.