Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
49a7dec5
Commit
49a7dec5
authored
Dec 18, 2006
by
zorglub
Browse files
Untested states thread and gnu portable threads implementation of tls
Fix Win32 implementation
parent
651078ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/vlc_threads.h
View file @
49a7dec5
...
...
@@ -141,6 +141,7 @@ typedef struct
}
vlc_cond_t
;
typedef
struct
{
int
handle
;
}
vlc_threadvar_t
;
#elif defined( ST_INIT_IN_ST_H )
...
...
@@ -157,6 +158,7 @@ typedef struct
}
vlc_cond_t
;
typedef
struct
{
int
handle
;
}
vlc_threadvar_t
;
#elif defined( WIN32 ) || defined( UNDER_CE )
...
...
include/vlc_threads_funcs.h
View file @
49a7dec5
...
...
@@ -565,12 +565,15 @@ static inline int __vlc_threadvar_set( char* psz_file, int line,
{
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
);
...
...
@@ -593,10 +596,12 @@ static inline void* __vlc_threadvar_get( char* psz_file, int line,
{
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
);
...
...
src/misc/threads.c
View file @
49a7dec5
...
...
@@ -506,11 +506,12 @@ int __vlc_cond_destroy( const char * psz_file, int i_line, vlc_cond_t *p_condvar
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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment