Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
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
Show 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;
#if defined( UNDER_CE )
#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
** implementation (more precisely there is a possibility for a race
...
...
@@ -146,7 +139,6 @@ int __vlc_threads_init( vlc_object_t *p_this )
if
(
IsDebuggerPresent
()
)
{
/* SignalObjectAndWait() is problematic under a debugger */
b_fast_mutex
=
true
;
i_win9x_cv
=
1
;
}
#elif defined( HAVE_KERNEL_SCHEDULER_H )
...
...
@@ -253,17 +245,8 @@ int __vlc_mutex_init( vlc_mutex_t *p_mutex )
return
0
;
#elif defined( WIN32 )
if
(
!
b_fast_mutex
)
{
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 )
/* check the arguments and whether it's already been initialized */
...
...
@@ -392,8 +375,6 @@ int __vlc_cond_init( vlc_cond_t *p_condvar )
/* Misc init */
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 */
FALSE
,
/* auto-reset event */
...
...
@@ -402,25 +383,6 @@ int __vlc_cond_init( vlc_cond_t *p_condvar )
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
;
}
#elif defined( HAVE_KERNEL_SCHEDULER_H )
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