From 65f43637ceeaf4042c5fb5e02cb2fb2ccc496a64 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 16 Mar 2010 18:54:36 -0700 Subject: Avoid some alIs* calls while under the context lock Instead, use functions that verify the ID by searching the object list and returning its handle --- OpenAL32/Include/alMain.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenAL32/Include/alMain.h') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 19a57b6c..34120b00 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -379,6 +379,18 @@ void al_print(const char *fname, unsigned int line, const char *fmt, ...) ALCboolean ALCAPIENTRY alcMakeCurrent(ALCcontext *context); ALCcontext* ALCAPIENTRY alcGetThreadContext(void); +#define DECL_VERIFIER(name, type, field) \ +static type* Verify##name(type *list, ALuint id) \ +{ \ + while(list) \ + { \ + if(list->field == id) \ + break; \ + list = list->next; \ + } \ + return list; \ +} + #ifdef __cplusplus } #endif -- cgit v1.2.3