bfbf3d926b5e51622c78dfbbf2a5c94ab7d36522
[scm/bb/meta-tizen.git] / recipes-multimedia / pulseaudio / pulseaudio_5.0 / 0006-make-pa_thread_mq_done-safe-for-subsequent-calls.patch
1 From: Janos Kovacs <jankovac503@gmail.com>
2 Date: Thu, 16 Aug 2012 03:47:48 +0300
3 Subject: make pa_thread_mq_done() safe for subsequent calls
4
5 Change-Id: I71ab9efa72c38a2200a56b7a4d30116767bc104f
6 Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
7 ---
8  src/pulsecore/thread-mq.c | 8 ++++++++
9  1 file changed, 8 insertions(+)
10
11 diff --git a/src/pulsecore/thread-mq.c b/src/pulsecore/thread-mq.c
12 index d34b22b..f3c5b6c 100644
13 --- a/src/pulsecore/thread-mq.c
14 +++ b/src/pulsecore/thread-mq.c
15 @@ -144,6 +144,14 @@ void pa_thread_mq_init(pa_thread_mq *q, pa_mainloop_api *mainloop, pa_rtpoll *rt
16  void pa_thread_mq_done(pa_thread_mq *q) {
17      pa_assert(q);
18  
19 +    if (!q->main_mainloop && !q->inq && !q->outq &&
20 +        !q->read_main_event && !q->write_main_event)
21 +        return;
22 +
23 +    pa_assert(q->main_mainloop);
24 +    pa_assert(q->inq && q->outq);
25 +    pa_assert(q->read_main_event && q->write_main_event);
26 +
27      /* Since we are called from main context we can be sure that the
28       * inq is empty. However, the outq might still contain messages
29       * for the main loop, which we need to dispatch (e.g. release