* access this data safely, we must extend our example a bit:
*
* \code
- * static int *drain_result;
+ * static volatile int *drain_result = NULL;
*
* static void my_drain_callback(pa_stream*s, int success, void *userdata) {
* pa_threaded_mainloop *m;
* o = pa_stream_drain(s, my_drain_callback, m);
* assert(o);
*
- * while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
+ * while (drain_result == NULL)
* pa_threaded_mainloop_wait(m);
*
* pa_operation_unref(o);
* that they can be called at any time. The threaded main loop API provides
* the locking mechanism to handle concurrent accesses, but nothing else.
* Applications will have to handle communication from the callback to the
- * main program through its own mechanisms.
+ * main program through their own mechanisms.
*
* The callbacks that are completely asynchronous are:
*
* are executed with this lock held. */
void pa_threaded_mainloop_lock(pa_threaded_mainloop *m);
-/** Unlock the event loop object, inverse of pa_threaded_mainloop_lock() */
+/** Unlock the event loop object, inverse of pa_threaded_mainloop_lock(). */
void pa_threaded_mainloop_unlock(pa_threaded_mainloop *m);
/** Wait for an event to be signalled by the event loop thread. You
void pa_threaded_mainloop_wait(pa_threaded_mainloop *m);
/** Signal all threads waiting for a signalling event in
- * pa_threaded_mainloop_wait(). If wait_for_release is non-zero, do
+ * pa_threaded_mainloop_wait(). If wait_for_accept is non-zero, do
* not return before the signal was accepted by a
* pa_threaded_mainloop_accept() call. While waiting for that condition
* the event loop object is unlocked. */
/** Returns non-zero when called from within the event loop thread. \since 0.9.7 */
int pa_threaded_mainloop_in_thread(pa_threaded_mainloop *m);
+/** Sets the name of the thread. \since 5.0 */
+void pa_threaded_mainloop_set_name(pa_threaded_mainloop *m, const char *name);
+
PA_C_DECL_END
#endif