loopback: Flush asyncmsgq from the right context
authorTanu Kaskinen <tanuk@iki.fi>
Thu, 14 Mar 2013 20:07:14 +0000 (22:07 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 22 Mar 2013 18:49:56 +0000 (20:49 +0200)
commit259be540e3bc7451305de09c196bc3b49dc38e53
treed92d9c37c0b8f4c685c763b24d7f35ca8699420f
parentee0a5d50148ee1d99a511372ae2af2036b6612a2
loopback: Flush asyncmsgq from the right context

u->asyncmsg is accessed from two IO threads. teardown() shouldn't
flush the queue from the main thread while both IO threads are still
potentially using the queue. This patch fixes that error by flushing
the queue from the sink input thread when the sink input is being
unlinked.

Flushing the queue in teardown() caused this assertion in
pa_asyncmsgq_get() to crash sometimes: pa_assert(!a->current)
src/modules/module-loopback.c