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
aac94890
Commit
aac94890
authored
Dec 30, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: fix previous commit plus small optimization
parent
c72c34ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
include/vlc_threads.h
include/vlc_threads.h
+6
-2
src/misc/w32thread.c
src/misc/w32thread.c
+7
-2
No files found.
include/vlc_threads.h
View file @
aac94890
...
...
@@ -126,12 +126,16 @@ typedef struct
{
bool
dynamic
;
union
{
struct
{
bool
locked
;
unsigned
long
contention
;
};
CRITICAL_SECTION
mutex
;
}
;
}
vlc_mutex_t
;
#define VLC_STATIC_MUTEX { false, {
false
} }
#define VLC_STATIC_MUTEX { false, {
{ false, 0 }
} }
typedef
HANDLE
vlc_cond_t
;
typedef
HANDLE
vlc_sem_t
;
...
...
src/misc/w32thread.c
View file @
aac94890
...
...
@@ -195,7 +195,11 @@ void vlc_mutex_lock (vlc_mutex_t *p_mutex)
vlc_mutex_lock
(
&
super_mutex
);
while
(
p_mutex
->
locked
)
vlc_cond_wait
(
&
super_mutex
,
&
super_variable
);
{
p_mutex
->
contention
++
;
vlc_cond_wait
(
&
super_variable
,
&
super_mutex
);
p_mutex
->
contention
--
;
}
p_mutex
->
locked
=
true
;
vlc_mutex_unlock
(
&
super_mutex
);
return
;
...
...
@@ -233,7 +237,8 @@ void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
vlc_mutex_lock
(
&
super_mutex
);
assert
(
p_mutex
->
locked
);
p_mutex
->
locked
=
false
;
vlc_cond_signal
(
&
super_variable
);
if
(
p_mutex
->
contention
)
vlc_cond_broadcast
(
&
super_variable
);
vlc_mutex_unlock
(
&
super_mutex
);
return
;
}
...
...
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