Changeset 49a7dec5d6f8f2ca73b937badc50a8a3b6146666

Show
Ignore:
Timestamp:
18/12/06 22:53:26 (2 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1166478806 +0000
git-parent:

[651078ecf9be6d0bb9c2323023ebb7fbd7f0d145]

git-author:
Clément Stenac <zorglub@videolan.org> 1166478806 +0000
Message:

Untested states thread and gnu portable threads implementation of tls
Fix Win32 implementation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_threads.h

    r651078e r49a7dec  
    142142typedef struct 
    143143{ 
     144    int handle; 
    144145} vlc_threadvar_t; 
    145146 
     
    158159typedef struct 
    159160{ 
     161    int handle; 
    160162} vlc_threadvar_t; 
    161163 
  • include/vlc_threads_funcs.h

    r651078e r49a7dec  
    566566    int i_ret; 
    567567 
    568 #if defined( PTH_INIT_IN_PTH_H ) || \ 
    569     defined( ST_INIT_IN_ST_H ) || defined( HAVE_KERNEL_SCHEDULER_H ) 
     568#if defined( PTH_INIT_IN_PTH_H ) 
     569    return pth_key_setdata( p_tls->handle, p_value ); 
     570#elif  defined( ST_INIT_IN_ST_H ) 
     571    return st_thread_setspecific( p_tls->handle, p_value ); 
     572#elif defined( HAVE_KERNEL_SCHEDULER_H ) 
    570573    return -1; 
    571574 
    572575#elif defined( UNDER_CE ) || defined( WIN32 ) 
    573     i_ret = ( TlsSetValue( &p_tls->handle, p_value ) != 0 ); 
     576    i_ret = ( TlsSetValue( p_tls->handle, p_value ) != 0 ); 
    574577 
    575578#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) 
     
    594597    void* p_ret; 
    595598 
    596 #if defined( PTH_INIT_IN_PTH_H ) || \ 
    597     defined( ST_INIT_IN_ST_H ) || defined( HAVE_KERNEL_SCHEDULER_H ) 
    598     return NULL; 
    599  
     599#if defined( PTH_INIT_IN_PTH_H ) 
     600    p_ret = pth_key_getdata( p_handle->key ); 
     601#elif defined( ST_INIT_IN_ST_H ) 
     602    p_ret = st_thread_getspecific( p_handle->key ); 
     603#elif defined( HAVE_KERNEL_SCHEDULER_H ) 
     604    p_ret = NULL; 
    600605#elif defined( UNDER_CE ) || defined( WIN32 ) 
    601606    p_ret = TlsGetValue( &p_tls->handle ); 
  • src/misc/threads.c

    r651078e r49a7dec  
    507507{ 
    508508#if defined( PTH_INIT_IN_PTH_H ) 
    509 #elif defined( HAVE_KERNEL_SCHEDULER_H ) 
    510 #elif defined( ST_INIT_IN_ST_H ) 
     509    return pth_key_create( &p_tls->handle, NULL ); 
     510#elif defined( HAVE_KERNEL_SCHEDULER_H ) 
    511511    msg_Err( p_this, "TLS not implemented" ); 
    512512    return VLC_EGENERIC; 
    513  
     513#elif defined( ST_INIT_IN_ST_H ) 
     514    return st_key_create( &p_tls->handle, NULL ); 
    514515#elif defined( UNDER_CE ) || defined( WIN32 ) 
    515516#elif defined( WIN32 )