[pulseaudio-discuss] [PATCH] thread-mainloop: fix volatile use in example

Georg Chini georg at chini.tk
Mon Apr 3 17:01:59 UTC 2017


On 28.10.2016 18:00, Tanu Kaskinen wrote:
> In the example, drain_result is a volatile pointer to an int, not
> a regular pointer to a volatile int.
> ---
>   src/pulse/thread-mainloop.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/pulse/thread-mainloop.h b/src/pulse/thread-mainloop.h
> index 40278b4..e69298a 100644
> --- a/src/pulse/thread-mainloop.h
> +++ b/src/pulse/thread-mainloop.h
> @@ -164,7 +164,7 @@ PA_C_DECL_BEGIN
>    * access this data safely, we must extend our example a bit:
>    *
>    * \code
> - * static volatile int *drain_result = NULL;
> + * static int * volatile drain_result = NULL;
>    *
>    * static void my_drain_callback(pa_stream*s, int success, void *userdata) {
>    *     pa_threaded_mainloop *m;

Looks good to me.



More information about the pulseaudio-discuss mailing list