{
int i_ret;
-#if defined( PTH_INIT_IN_PTH_H ) || \
- defined( ST_INIT_IN_ST_H ) || defined( HAVE_KERNEL_SCHEDULER_H )
+#if defined( PTH_INIT_IN_PTH_H )
+ return pth_key_setdata( p_tls->handle, p_value );
+#elif defined( ST_INIT_IN_ST_H )
+ return st_thread_setspecific( p_tls->handle, p_value );
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
return -1;
#elif defined( UNDER_CE ) || defined( WIN32 )
- i_ret = ( TlsSetValue( &p_tls->handle, p_value ) != 0 );
+ i_ret = ( TlsSetValue( p_tls->handle, p_value ) != 0 );
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
i_ret = pthread_setspecific( p_tls->handle, p_value );
{
void* p_ret;
-#if defined( PTH_INIT_IN_PTH_H ) || \
- defined( ST_INIT_IN_ST_H ) || defined( HAVE_KERNEL_SCHEDULER_H )
- return NULL;
-
+#if defined( PTH_INIT_IN_PTH_H )
+ p_ret = pth_key_getdata( p_handle->key );
+#elif defined( ST_INIT_IN_ST_H )
+ p_ret = st_thread_getspecific( p_handle->key );
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
+ p_ret = NULL;
#elif defined( UNDER_CE ) || defined( WIN32 )
p_ret = TlsGetValue( &p_tls->handle );
int __vlc_threadvar_create( vlc_object_t *p_this, vlc_threadvar_t *p_tls )
{
#if defined( PTH_INIT_IN_PTH_H )
+ return pth_key_create( &p_tls->handle, NULL );
#elif defined( HAVE_KERNEL_SCHEDULER_H )
-#elif defined( ST_INIT_IN_ST_H )
msg_Err( p_this, "TLS not implemented" );
return VLC_EGENERIC;
-
+#elif defined( ST_INIT_IN_ST_H )
+ return st_key_create( &p_tls->handle, NULL );
#elif defined( UNDER_CE ) || defined( WIN32 )
#elif defined( WIN32 )
p_tls->handle = TlsAlloc();