diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2011-04-04 03:33:46 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-04-04 11:05:45 +0200 |
commit | 7c6d9c2725a9632fbd96fd41b60ed814649d3bec (patch) | |
tree | 0388ae0ed79f7f5446aa779eb4cb6890db6692ba /gst/gstpoll.c | |
parent | eba33c1de11fc7fb63fb31a764d3c16698eea490 (diff) |
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.
Diffstat (limited to 'gst/gstpoll.c')
-rw-r--r-- | gst/gstpoll.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/gstpoll.c b/gst/gstpoll.c index fbcf2b2e3..76a7a30e6 100644 --- a/gst/gstpoll.c +++ b/gst/gstpoll.c @@ -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; |