task: Fix pause/stop race condition
authorHaakon Sporsheim <haakon.sporsheim@gmail.com>
Wed, 12 Nov 2014 10:30:51 +0000 (11:30 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 12 Nov 2014 11:00:48 +0000 (12:00 +0100)
commit6c079367f12ad5ded5e73e9b0a20d03ac1402f29
tree8f081821b4d6fc53b00cf0a85bc5f4426d7326bf
parentd600fc48f8486428b70cbfd841af80a1a36c2519
task: Fix pause/stop race condition

If a task thread is calling pause on it self and the
controlling/"main" thread stops the task, it could end in a race
where gst_task_func loops and then checks for paused after the
controlling thread just changed the task state to stopped.
Hence the task would actually call func again even though it was
both paused and stopped.

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