aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-08-18 15:58:04 -0700
committerChris Robinson <[email protected]>2012-08-18 15:58:04 -0700
commit0865db564fa86df6c02ab10ec62cfbbe98f8c917 (patch)
treec3ea9c6c1dc274776fd29c409e2231fa949e9742 /OpenAL32/Include
parent2b020040b41a8a8a19869263ad2816daad2e1361 (diff)
Move the device lock into the backend function table
For backend-specific implementations: this should hold the audio mixer loop for playback devices, and provide recursive mutex behavior.
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index d12fe3f8..8ff792d0 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -446,6 +446,9 @@ typedef struct {
ALCenum (*CaptureSamples)(ALCdevice*, void*, ALCuint);
ALCuint (*AvailableSamples)(ALCdevice*);
+ void (*Lock)(ALCdevice*);
+ void (*Unlock)(ALCdevice*);
+
ALint64 (*GetLatency)(ALCdevice*);
} BackendFuncs;
@@ -632,6 +635,8 @@ struct ALCdevice_struct
#define ALCdevice_StopCapture(a) ((a)->Funcs->StopCapture((a)))
#define ALCdevice_CaptureSamples(a,b,c) ((a)->Funcs->CaptureSamples((a), (b), (c)))
#define ALCdevice_AvailableSamples(a) ((a)->Funcs->AvailableSamples((a)))
+#define ALCdevice_Lock(a) ((a)->Funcs->Lock((a)))
+#define ALCdevice_Unlock(a) ((a)->Funcs->Unlock((a)))
#define ALCdevice_GetLatency(a) ((a)->Funcs->GetLatency((a)))
// Frequency was requested by the app or config file
@@ -703,15 +708,13 @@ void ALCcontext_DecRef(ALCcontext *context);
void AppendAllDevicesList(const ALCchar *name);
void AppendCaptureDeviceList(const ALCchar *name);
-static __inline void LockDevice(ALCdevice *device)
-{ EnterCriticalSection(&device->Mutex); }
-static __inline void UnlockDevice(ALCdevice *device)
-{ LeaveCriticalSection(&device->Mutex); }
+void ALCdevice_LockDefault(ALCdevice *device);
+void ALCdevice_UnlockDefault(ALCdevice *device);
static __inline void LockContext(ALCcontext *context)
-{ LockDevice(context->Device); }
+{ ALCdevice_Lock(context->Device); }
static __inline void UnlockContext(ALCcontext *context)
-{ UnlockDevice(context->Device); }
+{ ALCdevice_Unlock(context->Device); }
void *al_malloc(size_t alignment, size_t size);