thread-mainloop: Extend the locking documentation a bit
authorTanu Kaskinen <tanuk@iki.fi>
Wed, 27 May 2020 06:41:40 +0000 (09:41 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 27 May 2020 06:41:40 +0000 (09:41 +0300)
Make it more clear which objects require locking. I remember talking to
multiple people for whom that wasn't immediately clear from the
documentation.

src/pulse/thread-mainloop.h

index 26fa4ed..fd9ad3c 100644 (file)
@@ -66,9 +66,11 @@ PA_C_DECL_BEGIN
  * number of times you called pa_threaded_mainloop_lock().
  *
  * The lock needs to be held whenever you call any PulseAudio function that
- * uses an object associated with this main loop. Make sure you do not hold
- * on to the lock more than necessary though, as the threaded main loop stops
- * while the lock is held.
+ * uses an object associated with this main loop. Those objects include
+ * pa_mainloop, pa_context, pa_stream and pa_operation, and the various event
+ * objects (pa_io_event, pa_time_event, pa_defer_event). Make sure you do not
+ * hold on to the lock more than necessary though, as the threaded main loop
+ * stops while the lock is held.
  *
  * Example:
  *