GNOME Bugzilla – Bug 737999
systemclock: multi-thread entry status issue
Last modified: 2014-10-24 19:39:36 UTC
Created attachment 287844 [details] test file to reproduce the issue Running two threads, one executing the timer and one unscheduling it, the unscheduled status set by the second thread is sometimes overwritten by the first one. I have attached a C test file to reproduce the issue Here is the log I have with the small test application: ** Message: set timer ** Message: task GST_CLOCK_EARLY ** Message: unschedule current timer ** Message: task GST_CLOCK_UNSCHEDULED ** Message: set timer ** Message: task GST_CLOCK_EARLY ** Message: unschedule current timer ** Message: task GST_CLOCK_OK ** Message: task GST_CLOCK_OK ** Message: task GST_CLOCK_OK Once the status is overwritten, I do not receive anymore the GST_CLOCK_UNSCHEDULED. I have attached the patch that fix this issue.
Created attachment 287845 [details] [review] fix multi-thread entry status issue
Review of attachment 287845 [details] [review]: ::: gst/gstsystemclock.c @@ -739,3 @@ /* timeout, this is fine, we can report success now */ - status = GST_CLOCK_OK; - SET_ENTRY_STATUS (entry, status); You're not setting the status at all anymore @@ -768,3 @@ - status = GST_CLOCK_EARLY; - - SET_ENTRY_STATUS (entry, status); And here
Review of attachment 287845 [details] [review]: ::: gst/gstsystemclock.c @@ -739,3 @@ /* timeout, this is fine, we can report success now */ - status = GST_CLOCK_OK; - SET_ENTRY_STATUS (entry, status); I set the status using CAS_ENTRY_STATUS. If the status has been modified by another thread, I do not modify it.
Oh I missed that, sorry. Then the patch seems fine, thanks! commit 00bcd94723f565c087ce559ab32cc49a74c30a8f Author: Nicolas Huet <nicolas.huet@parrot.com> Date: Mon Oct 6 13:38:21 2014 +0200 systemclock: fix multi-thread entry status issue Running two threads, one executing the timer and one unscheduling it, the unscheduled status set by the second thread is sometimes overwritten by the first one. https://bugzilla.gnome.org/show_bug.cgi?id=737999