aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-05-10 22:49:24 -0700
committerChris Robinson <[email protected]>2016-05-10 22:49:24 -0700
commit906a4bb22d6811615ccff417b6086fa36f310c00 (patch)
tree3c4a345d7f5a49e06062874566b4635c0f7567a1 /OpenAL32/Include
parentc026f44a092a566a18fef78d2517fead84ed2db8 (diff)
Hold the source map lock while handling it
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alSource.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 6c821703..187d7e07 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -138,10 +138,19 @@ typedef struct ALsource {
ALuint id;
} ALsource;
+inline void LockSourcesRead(ALCcontext *context)
+{ LockUIntMapRead(&context->SourceMap); }
+inline void UnlockSourcesRead(ALCcontext *context)
+{ UnlockUIntMapRead(&context->SourceMap); }
+inline void LockSourcesWrite(ALCcontext *context)
+{ LockUIntMapWrite(&context->SourceMap); }
+inline void UnlockSourcesWrite(ALCcontext *context)
+{ UnlockUIntMapWrite(&context->SourceMap); }
+
inline struct ALsource *LookupSource(ALCcontext *context, ALuint id)
-{ return (struct ALsource*)LookupUIntMapKey(&context->SourceMap, id); }
+{ return (struct ALsource*)LookupUIntMapKeyNoLock(&context->SourceMap, id); }
inline struct ALsource *RemoveSource(ALCcontext *context, ALuint id)
-{ return (struct ALsource*)RemoveUIntMapKey(&context->SourceMap, id); }
+{ return (struct ALsource*)RemoveUIntMapKeyNoLock(&context->SourceMap, id); }
ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state);
ALboolean ApplyOffset(ALsource *Source);