GNOME Bugzilla – Bug 764865
audiosrc, audiosink: race in gstaudiosrc audioringbuffer thread
Last modified: 2016-04-11 11:53:14 UTC
Created attachment 325684 [details] [review] audio: Fix a race with the audioringbuffer thread I think I found a race problem occurring in some rare situations, in the audioringbuffer thread, when the src->thread variable is used in the audioringbuffer thread _before_ it is updated in the parent thread with src->thread = g_thread_try_new(...). The same situation may probably happen in sink too, even if I only observed the problem in the gstaudiosrc myself.
A simpler solution is just to use g_thread_self() in the child thread to get the GThread directly.
Created attachment 325718 [details] [review] audio: Fix a race with the audioringbuffer thread Yes, thanks for this suggestion: updated patch, using g_thread_self() instead of the variable set by the parent thread.
Thanks! Pushed: commit bfcd0737b7acd8fa5f055f49641fa3101bfb76de Author: Fabrice Bellet <fabrice@bellet.info> Date: Mon Apr 11 11:28:09 2016 +0200 audio: Fix a race with the audioringbuffer thread There is a small window of time where the audio ringbuffer thread can access the parent thread variable, before it's initialized by the parent thread. The patch replaces this variable use by g_thread_self(). https://bugzilla.gnome.org/show_bug.cgi?id=764865