diff options
author | Chris Robinson <[email protected]> | 2010-03-16 18:54:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-03-16 18:54:36 -0700 |
commit | 65f43637ceeaf4042c5fb5e02cb2fb2ccc496a64 (patch) | |
tree | b9a765d39e15cd7d352eb713fa587319880fdf22 /OpenAL32/Include | |
parent | f37cfc486d9f7ff84d21395f9135819f0b24f274 (diff) |
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
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alMain.h | 12 |
1 files changed, 12 insertions, 0 deletions
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 |