From 9a95fe49c848d2711dcdcf4c407e626e41e4657f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 13 Aug 2009 02:14:19 +0200 Subject: core: add assert macros for verifying calling context This adds pa_assert_io_context() and pa_assert_ctl_context() in addition to a few related macros. When called they will fail when the current execution context is not IO resp. not control context. (aka 'thread' context vs. 'main' context) --- src/pulsecore/sink-input.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pulsecore/sink-input.h') diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h index 98144d41..5ede1ca8 100644 --- a/src/pulsecore/sink-input.h +++ b/src/pulsecore/sink-input.h @@ -359,4 +359,7 @@ pa_memchunk* pa_sink_input_get_silence(pa_sink_input *i, pa_memchunk *ret); /* To be used by sink.c only */ void pa_sink_input_set_relative_volume(pa_sink_input *i, const pa_cvolume *v); +#define pa_sink_input_assert_io_context(s) \ + pa_assert(pa_thread_mq_get() || !PA_SINK_INPUT_IS_LINKED((s)->state)) + #endif -- cgit