diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-06-17 18:07:42 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-06-18 08:20:05 +0530 |
commit | 9a0dd113429909ca998bc6970ae0c50e5aa138b0 (patch) | |
tree | 5fd94f422bc38ebc8a290d4b76f3caf10575f487 /src | |
parent | b2792d783745ec726a00c4805402a77870549156 (diff) | |
download | pulseaudio-9a0dd113429909ca998bc6970ae0c50e5aa138b0.tar.gz |
mainloop: Document need for mainloop lock around pa_mainloop_api_once
This needs us to expose a bit of implementation detail, but this seems
to be the cleanest way without an API change.
The specific problem is that pa_mainloop_api_once() needs to first
create a defer event and then set its destroy callback. If the defer
event is completed before the callback is set, an assert will be
trigerred.
Diffstat (limited to 'src')
-rw-r--r-- | src/pulse/mainloop-api.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pulse/mainloop-api.h b/src/pulse/mainloop-api.h index 018ae19b8..e75496097 100644 --- a/src/pulse/mainloop-api.h +++ b/src/pulse/mainloop-api.h @@ -114,7 +114,9 @@ struct pa_mainloop_api { void (*quit)(pa_mainloop_api*a, int retval); }; -/** Run the specified callback function once from the main loop using an anonymous defer event. */ +/** Run the specified callback function once from the main loop using an anonymous defer event. Note that this performs + * multiple mainloop operations non-atomically. If, for example, you are using a \pa_threaded_mainloop, you will need to + * take the mainloop lock before this call. */ void pa_mainloop_api_once(pa_mainloop_api*m, void (*callback)(pa_mainloop_api*m, void *userdata), void *userdata); PA_C_DECL_END |