GNOME Bugzilla – Bug 381492
[SystemClock] ClockID wait_async notification broken
Last modified: 2006-12-17 18:45:12 UTC
Situation: With the system clock, create two clock ids for some clock times T1 and T2 in the future such that T1 < T2. Perform an async_wait on the id for T2, then the same for the other id. Note that the chronological order is swapped; the id to trigger first is added for async notification in second (which should not matter). Expected result: At T1 and T2, a notification happens for each clock id respectively. Actual result: The clock ignores the early id until T2 is reached, at which point it notifies the id for T2 and then the T1 id shortly afterwards. Attaching a testsuite addition that demonstrates the problem.
Created attachment 77522 [details] [review] Testsuite addition to demonstrate broken async notification
That's just awesome, thanks for noticing. This will have to wait a couple of days for after the release.
Patch by: Rene Stadler <mail at renestadler dot de> * gst/gstclock.c: (gst_clock_id_wait): Make period ids add the interval to the origial requested time instead of the possibly updated time which can be wrong when there are multiple waiters for the same id. Fixes #382592. * gst/gstsystemclock.c: (gst_system_clock_async_thread), (gst_system_clock_id_wait_jitter_unlocked), (gst_system_clock_id_wait_jitter): Fix restart in the async notify thread when an async entry is added to the front of the list. Fixes #381492. * tests/check/gst/gstsystemclock.c: (store_callback), (notify_callback), (GST_START_TEST), (gst_systemclock_suite): Added test for multiple async waits. Added test for async wait order.