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
b648be13
Commit
b648be13
authored
Apr 23, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: don't use spin locks^W^Wfast mutexes instead of mutexes
parent
463b756d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
47 deletions
+9
-47
src/misc/threads.c
src/misc/threads.c
+9
-47
No files found.
src/misc/threads.c
View file @
b648be13
...
@@ -51,13 +51,6 @@ static vlc_object_t *p_root;
...
@@ -51,13 +51,6 @@ static vlc_object_t *p_root;
#if defined( UNDER_CE )
#if defined( UNDER_CE )
#elif defined( WIN32 )
#elif defined( WIN32 )
/*
** On Windows NT/2K/XP we use a slow mutex implementation but which
** allows us to correctly implement condition variables.
** You can also use the faster Win9x implementation but you might
** experience problems with it.
*/
static
bool
b_fast_mutex
=
false
;
/*
/*
** On Windows 9x/Me you can use a fast but incorrect condition variables
** On Windows 9x/Me you can use a fast but incorrect condition variables
** implementation (more precisely there is a possibility for a race
** implementation (more precisely there is a possibility for a race
...
@@ -146,7 +139,6 @@ int __vlc_threads_init( vlc_object_t *p_this )
...
@@ -146,7 +139,6 @@ int __vlc_threads_init( vlc_object_t *p_this )
if
(
IsDebuggerPresent
()
)
if
(
IsDebuggerPresent
()
)
{
{
/* SignalObjectAndWait() is problematic under a debugger */
/* SignalObjectAndWait() is problematic under a debugger */
b_fast_mutex
=
true
;
i_win9x_cv
=
1
;
i_win9x_cv
=
1
;
}
}
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( HAVE_KERNEL_SCHEDULER_H )
...
@@ -253,17 +245,8 @@ int __vlc_mutex_init( vlc_mutex_t *p_mutex )
...
@@ -253,17 +245,8 @@ int __vlc_mutex_init( vlc_mutex_t *p_mutex )
return
0
;
return
0
;
#elif defined( WIN32 )
#elif defined( WIN32 )
if
(
!
b_fast_mutex
)
p_mutex
->
mutex
=
CreateMutex
(
0
,
FALSE
,
0
);
{
return
(
p_mutex
->
mutex
!=
NULL
?
0
:
1
);
p_mutex
->
mutex
=
CreateMutex
(
0
,
FALSE
,
0
);
return
(
p_mutex
->
mutex
!=
NULL
?
0
:
1
);
}
else
{
p_mutex
->
mutex
=
NULL
;
InitializeCriticalSection
(
&
p_mutex
->
csection
);
return
0
;
}
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( HAVE_KERNEL_SCHEDULER_H )
/* check the arguments and whether it's already been initialized */
/* check the arguments and whether it's already been initialized */
...
@@ -392,35 +375,14 @@ int __vlc_cond_init( vlc_cond_t *p_condvar )
...
@@ -392,35 +375,14 @@ int __vlc_cond_init( vlc_cond_t *p_condvar )
/* Misc init */
/* Misc init */
p_condvar
->
i_win9x_cv
=
i_win9x_cv
;
p_condvar
->
i_win9x_cv
=
i_win9x_cv
;
if
(
!
b_fast_mutex
||
p_condvar
->
i_win9x_cv
==
0
)
/* Create an auto-reset event. */
{
p_condvar
->
event
=
CreateEvent
(
NULL
,
/* no security */
/* Create an auto-reset event. */
FALSE
,
/* auto-reset event */
p_condvar
->
event
=
CreateEvent
(
NULL
,
/* no security */
FALSE
,
/* start non-signaled */
FALSE
,
/* auto-reset event */
NULL
);
/* unnamed */
FALSE
,
/* start non-signaled */
NULL
);
/* unnamed */
p_condvar
->
semaphore
=
NULL
;
return
!
p_condvar
->
event
;
}
else
{
p_condvar
->
semaphore
=
CreateSemaphore
(
NULL
,
/* no security */
0
,
/* initial count */
0x7fffffff
,
/* max count */
NULL
);
/* unnamed */
if
(
p_condvar
->
i_win9x_cv
==
1
)
/* Create a manual-reset event initially signaled. */
p_condvar
->
event
=
CreateEvent
(
NULL
,
TRUE
,
TRUE
,
NULL
);
else
/* Create a auto-reset event. */
p_condvar
->
event
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
InitializeCriticalSection
(
&
p_condvar
->
csection
);
return
!
p_condvar
->
semaphore
||
!
p_condvar
->
event
;
p_condvar
->
semaphore
=
NULL
;
}
return
!
p_condvar
->
event
;
#elif defined( HAVE_KERNEL_SCHEDULER_H )
#elif defined( HAVE_KERNEL_SCHEDULER_H )
if
(
!
p_condvar
)
if
(
!
p_condvar
)
...
...
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