systemclock: Fix wait/unschedule race
authorStian Selnes <stian@pexip.com>
Wed, 10 Feb 2016 08:09:29 +0000 (09:09 +0100)
committerThiago Santos <thiagoss@osg.samsung.com>
Wed, 10 Feb 2016 11:59:33 +0000 (08:59 -0300)
commit2b0ff13d070f370286078c5531b2e13006e5ce98
treefa9ff8837985a59f2526d55596d68c1af72cb3c7
parent77a98d98cbed15e0bfdd8fe982b7ac83b1826d13
systemclock: Fix wait/unschedule race

Fixes a race where an entry is set to BUSY in
gst_system_clock_id_wait_jitter() and is UNSCHEDULED before
gst_system_clock_id_wait_jitter_unlocked() starts processing it. The
wakeup added by gst_system_clock_id_unschedule() must be cleaned up.

Two stress tests are added. One test that triggers the specific issue
described above. The second stresses the code path where a wait is
rescheduled because the poll returned early.

https://bugzilla.gnome.org/show_bug.cgi?id=761586
gst/gstsystemclock.c
tests/check/gst/gstsystemclock.c