Ignore:
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 * 
    173 */ 
    184#include <pj/os.h> 
     
    192178{ 
    193179    char stack_ptr; 
     180    pj_status_t rc; 
    194181    pj_thread_t *thread = (pj_thread_t *)desc; 
    195182    pj_str_t thread_name = pj_str((char*)cstr_thread_name); 
     
    208195 
    209196    /* 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)); 
    211198    thread->hthread = GetCurrentThread(); 
    212199    thread->idthread = GetCurrentThreadId(); 
     
    225212        pj_sprintf(thread->obj_name, "thr%p", (void*)thread->idthread); 
    226213     
    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; 
    228217 
    229218    *thread_ptr = thread; 
     
    257246    PJ_LOG(6,(rec->obj_name, "Thread started")); 
    258247 
    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 
    260252    result = (*rec->proc)(rec->arg); 
    261253 
     
    586578 * pj_thread_local_set() 
    587579 */ 
    588 PJ_DEF(void) pj_thread_local_set(long index, void *value) 
    589 { 
     580PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value) 
     581{ 
     582    BOOL rc; 
     583 
    590584    //Can't check stack because this function is called in the 
    591585    //beginning before main thread is initialized. 
    592586    //PJ_CHECK_STACK(); 
    593     TlsSetValue(index, value); 
     587    rc = TlsSetValue(index, value); 
     588    return rc!=0 ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(GetLastError()); 
    594589} 
    595590 
Note: See TracChangeset for help on using the changeset viewer.