[PATCH] thread-mq: make pa_thread_mq_done() safe for subsequent calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Janos Kovacs <jankovac503@xxxxxxxxx>

---
 src/pulsecore/thread-mq.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/pulsecore/thread-mq.c b/src/pulsecore/thread-mq.c
index b492793..9efcd8a 100644
--- a/src/pulsecore/thread-mq.c
+++ b/src/pulsecore/thread-mq.c
@@ -97,6 +97,14 @@ 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);
 
+    if (!q->mainloop && !q->inq && !q->outq &&
+        !q->read_event && !q->write_event)
+        return;
+
+    pa_assert(q->mainloop);
+    pa_assert(q->inq && q->outq);
+    pa_assert(q->read_event && q->write_event);
+
     /* 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
-- 
1.8.1.2

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux