mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gstpoll: retry reading the control socket to release properly all wakeups
if set->control_pending is set to 0 but we didn't not succed reading the control socket, future calls to gst_poll_wait() will be awaiken by the control socket which will not be released properly because set->control_pending is already 0, causing an infinite loop.
This commit is contained in:
parent
eba33c1de1
commit
7c6d9c2725
1 changed files with 5 additions and 2 deletions
|
@ -210,8 +210,11 @@ release_all_wakeup (GstPoll * set)
|
|||
/* try to remove all pending control messages */
|
||||
if (g_atomic_int_compare_and_exchange (&set->control_pending, old, 0)) {
|
||||
/* we managed to remove all messages, read the control socket */
|
||||
(void) RELEASE_EVENT (set);
|
||||
break;
|
||||
if (RELEASE_EVENT (set))
|
||||
break;
|
||||
else
|
||||
/* retry again until we read it successfully */
|
||||
g_atomic_int_exchange_and_add (&set->control_pending, 1);
|
||||
}
|
||||
}
|
||||
return old;
|
||||
|
|
Loading…
Reference in a new issue