diff options
author | Chris Robinson <[email protected]> | 2011-06-30 18:10:04 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-06-30 18:10:04 -0700 |
commit | 723755788d645a04d7191dc631807660ce0125cb (patch) | |
tree | 40528da53b4652ea9b832cbb71079d024b6e13a6 /Alc | |
parent | 032d0836a74f0e17c99d68e3163f070397123abf (diff) |
Rename Suspend/ProcessContext since they are locking a mutex
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 32 | ||||
-rw-r--r-- | Alc/ALu.c | 8 | ||||
-rw-r--r-- | Alc/pulseaudio.c | 4 |
3 files changed, 22 insertions, 22 deletions
@@ -1317,10 +1317,10 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) if((device->Flags&DEVICE_RUNNING)) return ALC_TRUE; - SuspendContext(NULL); + LockContext(NULL); if(ALCdevice_ResetPlayback(device) == ALC_FALSE) { - ProcessContext(NULL); + UnlockContext(NULL); return ALC_FALSE; } device->Flags |= DEVICE_RUNNING; @@ -1384,7 +1384,7 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) if(ALEffect_DeviceUpdate(slot->EffectState, device) == AL_FALSE) { - ProcessContext(NULL); + UnlockContext(NULL); ALCdevice_StopPlayback(device); device->Flags &= ~DEVICE_RUNNING; return ALC_FALSE; @@ -1409,18 +1409,18 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) source->NeedsUpdate = AL_FALSE; } } - ProcessContext(NULL); + UnlockContext(NULL); return ALC_TRUE; } /* - SuspendContext + LockContext Thread-safe entry */ -ALCvoid SuspendContext(ALCcontext *pContext) +ALCvoid LockContext(ALCcontext *pContext) { (void)pContext; EnterCriticalSection(&g_csMutex); @@ -1428,11 +1428,11 @@ ALCvoid SuspendContext(ALCcontext *pContext) /* - ProcessContext + UnlockContext Thread-safe exit */ -ALCvoid ProcessContext(ALCcontext *pContext) +ALCvoid UnlockContext(ALCcontext *pContext) { (void)pContext; LeaveCriticalSection(&g_csMutex); @@ -1440,11 +1440,11 @@ ALCvoid ProcessContext(ALCcontext *pContext) /* - GetContextSuspended + GetLockedContext Returns the currently active Context, in a locked state */ -ALCcontext *GetContextSuspended(void) +ALCcontext *GetLockedContext(void) { ALCcontext *pContext = NULL; @@ -1459,7 +1459,7 @@ ALCcontext *GetContextSuspended(void) if(!pContext) pContext = GlobalContext; if(pContext) - SuspendContext(pContext); + LockContext(pContext); UnlockLists(); @@ -2123,7 +2123,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin return NULL; } - SuspendContext(NULL); + LockContext(NULL); ALContext = NULL; temp = realloc(device->Contexts, (device->NumContexts+1) * sizeof(*device->Contexts)); if(temp) @@ -2142,7 +2142,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin { free(ALContext); alcSetError(device, ALC_OUT_OF_MEMORY); - ProcessContext(NULL); + UnlockContext(NULL); if(device->NumContexts == 0) { ALCdevice_StopPlayback(device); @@ -2156,7 +2156,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin ALContext->Device = device; InitContext(ALContext); - ProcessContext(NULL); + UnlockContext(NULL); ALContext->next = g_pContextList; g_pContextList = ALContext; @@ -2200,7 +2200,7 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context) GlobalContext = NULL; Device = context->Device; - SuspendContext(NULL); + LockContext(NULL); for(i = 0;i < Device->NumContexts;i++) { if(Device->Contexts[i] == context) @@ -2210,7 +2210,7 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context) break; } } - ProcessContext(NULL); + UnlockContext(NULL); if(Device->NumContexts == 0) { @@ -972,7 +972,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) /* Clear mixing buffer */ memset(device->DryBuffer, 0, SamplesToDo*MAXCHANNELS*sizeof(ALfloat)); - SuspendContext(NULL); + LockContext(NULL); ctx = device->Contexts; ctx_end = ctx + device->NumContexts; while(ctx != ctx_end) @@ -1024,7 +1024,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ctx++; } - ProcessContext(NULL); + UnlockContext(NULL); //Post processing loop for(i = 0;i < SamplesToDo;i++) @@ -1075,7 +1075,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device) { ALuint i; - SuspendContext(NULL); + LockContext(NULL); for(i = 0;i < device->NumContexts;i++) { ALCcontext *Context = device->Contexts[i]; @@ -1096,5 +1096,5 @@ ALvoid aluHandleDisconnect(ALCdevice *device) } device->Connected = ALC_FALSE; - ProcessContext(NULL); + UnlockContext(NULL); } diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 01d6a71c..1a4789b3 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -361,7 +361,7 @@ static void stream_buffer_attr_callback(pa_stream *stream, void *pdata) //{{{ ALCdevice *Device = pdata; pulse_data *data = Device->ExtraData; - SuspendContext(NULL); + LockContext(NULL); data->attr = *(pa_stream_get_buffer_attr(stream)); Device->UpdateSize = data->attr.minreq / data->frame_size; @@ -372,7 +372,7 @@ static void stream_buffer_attr_callback(pa_stream *stream, void *pdata) //{{{ AL_PRINT("PulseAudio returned minreq > tlength/2; expect break up\n"); } - ProcessContext(NULL); + UnlockContext(NULL); }//}}} static void stream_device_callback(pa_stream *stream, void *pdata) //{{{ |