Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
5f3d03fb
Commit
5f3d03fb
authored
May 19, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use static storage rather than libvlc_global for stuff that is only used in a single file.
parent
acc91d37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
src/misc/threads.c
src/misc/threads.c
+10
-15
No files found.
src/misc/threads.c
View file @
5f3d03fb
...
...
@@ -27,6 +27,7 @@
#include <vlc/vlc.h>
#include <stdlib.h>
#include "libvlc.h"
#define VLC_THREADS_UNINITIALIZED 0
#define VLC_THREADS_PENDING 1
...
...
@@ -44,9 +45,12 @@ static vlc_object_t *p_root;
#elif defined( ST_INIT_IN_ST_H )
#elif defined( UNDER_CE )
#elif defined( WIN32 )
static
SIGNALOBJECTANDWAIT
SignalObjectAndWait
=
NULL
;
static
vlc_bool_t
b_fast_mutex
=
0
;
static
int
i_win9x_cv
=
0
;
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
static
pthread_mutex_t
once_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_mutex_t
once_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
#elif defined( HAVE_CTHREADS_H )
#endif
...
...
@@ -102,18 +106,11 @@ int __vlc_threads_init( vlc_object_t *p_this )
hInstLib
=
LoadLibrary
(
"kernel32"
);
if
(
hInstLib
)
{
p_libvlc_global
->
SignalObjectAndWait
=
SignalObjectAndWait
=
(
SIGNALOBJECTANDWAIT
)
GetProcAddress
(
hInstLib
,
"SignalObjectAndWait"
);
}
}
else
{
p_libvlc_global
->
SignalObjectAndWait
=
NULL
;
}
p_libvlc_global
->
b_fast_mutex
=
0
;
p_libvlc_global
->
i_win9x_cv
=
0
;
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
...
...
@@ -236,8 +233,7 @@ int __vlc_mutex_init( vlc_object_t *p_this, vlc_mutex_t *p_mutex )
* function and have a 100% correct vlc_cond_wait() implementation.
* As this function is not available on Win9x, we can use the faster
* CriticalSections */
if
(
p_this
->
p_libvlc_global
->
SignalObjectAndWait
&&
!
p_this
->
p_libvlc_global
->
b_fast_mutex
)
if
(
SignalObjectAndWait
&&
!
b_fast_mutex
)
{
/* We are running on NT/2K/XP, we can use SignalObjectAndWait */
p_mutex
->
mutex
=
CreateMutex
(
0
,
FALSE
,
0
);
...
...
@@ -386,11 +382,10 @@ int __vlc_cond_init( vlc_object_t *p_this, vlc_cond_t *p_condvar )
p_condvar
->
i_waiting_threads
=
0
;
/* Misc init */
p_condvar
->
i_win9x_cv
=
p_this
->
p_libvlc_global
->
i_win9x_cv
;
p_condvar
->
SignalObjectAndWait
=
p_this
->
p_libvlc_global
->
SignalObjectAndWait
;
p_condvar
->
i_win9x_cv
=
i_win9x_cv
;
p_condvar
->
SignalObjectAndWait
=
SignalObjectAndWait
;
if
(
(
p_condvar
->
SignalObjectAndWait
&&
!
p_this
->
p_libvlc_global
->
b_fast_mutex
)
if
(
(
p_condvar
->
SignalObjectAndWait
&&
!
b_fast_mutex
)
||
p_condvar
->
i_win9x_cv
==
0
)
{
/* Create an auto-reset event. */
...
...
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