GNOME Bugzilla – Bug 775015
gstv4l2bufferpool: lock flush_stop against regular qbuf
Last modified: 2016-11-24 21:14:43 UTC
Created attachment 340688 [details] [review] gstv4l2bufferpool: lock flush_stop against regular qbuf Both gst_v4l2_buffer_pool_flush_stop and gst_v4l2_buffer_pool_qbuf manipulate the pool->buffers array and they can be called from different threads. Lock them properly and let flush_stop move the array contents into a temporary array on the stack to avoid having to call release_buffer under the object lock.
Review of attachment 340688 [details] [review]: This looks safe to remove that race. Looks like the root cause for bug #772521 which I didn't have time to address. It will increase the lock contention, but we can't trade correctness. Queuing / Streaming logic will be removed from the bufferpool in the future. I'll run some tests, and if nothing comes out, I'll backport this.
Attachment 340688 [details] pushed as 86f243b - gstv4l2bufferpool: lock flush_stop against regular qbuf
[1.8] 1a1871498a94b448c94561160e66de582d84cf67
[1.10] 6870dd77f337df6e7b49412190bb76d7643c394d