summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-14 04:18:23 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-14 04:18:28 +0200
commit9e21182e018db8755dea6368eed93a1a2b93f6f7 (patch)
tree9be389175ef9ee9ebfc9f7035f0c77753328a0e2 /src/pulsecore
parent446fb2c9fea4f9c3f268868547f5f11c287ecba0 (diff)
thread-mq: never drop queued messages for the main loop
Previously we might have dropped messages from IO trheads to the main thread. This tuend out to be problematic since this cause SHM release messages to be lost. More visibly however this could cause playback freezing when moving streams between sinks and removing the old sink right away.
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/thread-mq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pulsecore/thread-mq.c b/src/pulsecore/thread-mq.c
index 34f92a7e..ec67ae87 100644
--- a/src/pulsecore/thread-mq.c
+++ b/src/pulsecore/thread-mq.c
@@ -104,6 +104,13 @@ void pa_thread_mq_init(pa_thread_mq *q, pa_mainloop_api *mainloop, pa_rtpoll *rt
void pa_thread_mq_done(pa_thread_mq *q) {
pa_assert(q);
+ /* Since we are called from main context we can be sure that the
+ * inq is empty. However, the outq might still contain messages
+ * for the main loop, which we need to dispatch (e.g. release
+ * msgs, other stuff). Hence do so. */
+
+ pa_asyncmsgq_flush(q->outq, TRUE);
+
q->mainloop->io_free(q->read_event);
q->mainloop->io_free(q->write_event);
q->read_event = q->write_event = NULL;