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
b8711965
Commit
b8711965
authored
Jun 04, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: cond_wait can wake up without being signaled.
Pointed by Laurent.
parent
120e9bb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/control/event_async.c
src/control/event_async.c
+8
-5
No files found.
src/control/event_async.c
View file @
b8711965
...
...
@@ -61,6 +61,11 @@ static inline bool is_queue_initialized(libvlc_event_manager_t * p_em)
return
queue
(
p_em
)
!=
NULL
;
}
static
inline
bool
current_thread_is_asynch_thread
(
libvlc_event_manager_t
*
p_em
)
{
return
vlc_threadvar_get
(
queue
(
p_em
)
->
is_asynch_dispatch_thread_var
);
}
/* Lock must be held */
static
void
push
(
libvlc_event_manager_t
*
p_em
,
libvlc_event_listener_t
*
listener
,
libvlc_event_t
*
event
)
{
...
...
@@ -209,13 +214,11 @@ libvlc_event_async_ensure_listener_removal(libvlc_event_manager_t * p_em, libvlc
queue_lock
(
p_em
);
pop_listener
(
p_em
,
listener
);
bool
is_asynch_dispatch_thread
=
vlc_threadvar_get
(
queue
(
p_em
)
->
is_asynch_dispatch_thread_var
);
// Wait for the asynch_loop to have processed all events.
if
(
!
queue
(
p_em
)
->
is_idle
&&
!
is_asynch_dispatch_thread
)
if
(
!
current_thread_is_asynch_thread
(
p_em
)
)
{
vlc_cond_wait
(
&
queue
(
p_em
)
->
signal_idle
,
&
queue
(
p_em
)
->
lock
);
assert
(
queue
(
p_em
)
->
is_idle
);
while
(
!
queue
(
p_em
)
->
is_idle
)
vlc_cond_wait
(
&
queue
(
p_em
)
->
signal_idle
,
&
queue
(
p_em
)
->
lock
);
}
queue_unlock
(
p_em
);
}
...
...
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