Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
49a7dec5
Commit
49a7dec5
authored
Dec 18, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Untested states thread and gnu portable threads implementation of tls
Fix Win32 implementation
parent
651078ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
include/vlc_threads.h
include/vlc_threads.h
+2
-0
include/vlc_threads_funcs.h
include/vlc_threads_funcs.h
+12
-7
src/misc/threads.c
src/misc/threads.c
+3
-2
No files found.
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
Markdown
is supported
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