Restore a comment that was accidentally deleted
[openal-soft.git] / OpenAL32 / alAuxEffectSlot.c
blobb860b2b0edef8e75118aad0f3b2e4c1973598bde
1 /**
2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2007 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
21 #include "config.h"
23 #include <stdlib.h>
24 #include <math.h>
26 #include "AL/al.h"
27 #include "AL/alc.h"
28 #include "alMain.h"
29 #include "alAuxEffectSlot.h"
30 #include "alThunk.h"
31 #include "alError.h"
32 #include "alListener.h"
33 #include "alSource.h"
35 #include "almalloc.h"
38 extern inline void LockEffectSlotsRead(ALCcontext *context);
39 extern inline void UnlockEffectSlotsRead(ALCcontext *context);
40 extern inline void LockEffectSlotsWrite(ALCcontext *context);
41 extern inline void UnlockEffectSlotsWrite(ALCcontext *context);
42 extern inline struct ALeffectslot *LookupEffectSlot(ALCcontext *context, ALuint id);
43 extern inline struct ALeffectslot *RemoveEffectSlot(ALCcontext *context, ALuint id);
45 static void RemoveEffectSlotList(ALCcontext *Context, ALeffectslot *slot);
47 static UIntMap EffectStateFactoryMap;
48 static inline ALeffectStateFactory *getFactoryByType(ALenum type)
50 ALeffectStateFactory* (*getFactory)(void) = LookupUIntMapKey(&EffectStateFactoryMap, type);
51 if(getFactory != NULL)
52 return getFactory();
53 return NULL;
56 static void ALeffectState_IncRef(ALeffectState *state);
57 static void ALeffectState_DecRef(ALeffectState *state);
59 #define DO_UPDATEPROPS() do { \
60 if(!ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire)) \
61 UpdateEffectSlotProps(slot); \
62 else \
63 slot->NeedsUpdate = AL_TRUE; \
64 } while(0)
67 AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots)
69 ALCcontext *context;
70 ALeffectslot *first, *last;
71 ALsizei cur;
72 ALenum err;
74 context = GetContextRef();
75 if(!context) return;
77 if(!(n >= 0))
78 SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
80 first = last = NULL;
81 for(cur = 0;cur < n;cur++)
83 ALeffectslot *slot = al_calloc(16, sizeof(ALeffectslot));
84 err = AL_OUT_OF_MEMORY;
85 if(!slot || (err=InitEffectSlot(slot)) != AL_NO_ERROR)
87 al_free(slot);
88 alDeleteAuxiliaryEffectSlots(cur, effectslots);
89 SET_ERROR_AND_GOTO(context, err, done);
92 err = NewThunkEntry(&slot->id);
93 if(err == AL_NO_ERROR)
94 err = InsertUIntMapEntry(&context->EffectSlotMap, slot->id, slot);
95 if(err != AL_NO_ERROR)
97 FreeThunkEntry(slot->id);
98 ALeffectState_DecRef(slot->Effect.State);
99 if(slot->Params.EffectState)
100 ALeffectState_DecRef(slot->Params.EffectState);
101 al_free(slot);
103 alDeleteAuxiliaryEffectSlots(cur, effectslots);
104 SET_ERROR_AND_GOTO(context, err, done);
107 aluInitEffectPanning(slot);
109 if(!first) first = slot;
110 if(last) ATOMIC_STORE(&last->next, slot, almemory_order_relaxed);
111 last = slot;
113 effectslots[cur] = slot->id;
115 if(last != NULL)
117 ALeffectslot *root = ATOMIC_LOAD(&context->ActiveAuxSlotList);
118 do {
119 ATOMIC_STORE(&last->next, root, almemory_order_relaxed);
120 } while(!ATOMIC_COMPARE_EXCHANGE_WEAK(ALeffectslot*, &context->ActiveAuxSlotList,
121 &root, first));
124 done:
125 ALCcontext_DecRef(context);
128 AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots)
130 ALCcontext *context;
131 ALeffectslot *slot;
132 ALsizei i;
134 context = GetContextRef();
135 if(!context) return;
137 LockEffectSlotsWrite(context);
138 if(!(n >= 0))
139 SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
140 for(i = 0;i < n;i++)
142 if((slot=LookupEffectSlot(context, effectslots[i])) == NULL)
143 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
144 if(ReadRef(&slot->ref) != 0)
145 SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
148 // All effectslots are valid
149 for(i = 0;i < n;i++)
151 if((slot=RemoveEffectSlot(context, effectslots[i])) == NULL)
152 continue;
153 FreeThunkEntry(slot->id);
155 RemoveEffectSlotList(context, slot);
156 DeinitEffectSlot(slot);
158 memset(slot, 0, sizeof(*slot));
159 al_free(slot);
162 done:
163 UnlockEffectSlotsWrite(context);
164 ALCcontext_DecRef(context);
167 AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot)
169 ALCcontext *context;
170 ALboolean ret;
172 context = GetContextRef();
173 if(!context) return AL_FALSE;
175 LockEffectSlotsRead(context);
176 ret = (LookupEffectSlot(context, effectslot) ? AL_TRUE : AL_FALSE);
177 UnlockEffectSlotsRead(context);
179 ALCcontext_DecRef(context);
181 return ret;
184 AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint value)
186 ALCdevice *device;
187 ALCcontext *context;
188 ALeffectslot *slot;
189 ALeffect *effect = NULL;
190 ALenum err;
192 context = GetContextRef();
193 if(!context) return;
195 WriteLock(&context->PropLock);
196 LockEffectSlotsRead(context);
197 if((slot=LookupEffectSlot(context, effectslot)) == NULL)
198 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
199 switch(param)
201 case AL_EFFECTSLOT_EFFECT:
202 device = context->Device;
204 LockEffectsRead(device);
205 effect = (value ? LookupEffect(device, value) : NULL);
206 if(!(value == 0 || effect != NULL))
208 UnlockEffectsRead(device);
209 SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
211 err = InitializeEffect(device, slot, effect);
212 UnlockEffectsRead(device);
214 if(err != AL_NO_ERROR)
215 SET_ERROR_AND_GOTO(context, err, done);
216 break;
218 case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
219 if(!(value == AL_TRUE || value == AL_FALSE))
220 SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
221 slot->AuxSendAuto = value;
222 break;
224 default:
225 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
227 DO_UPDATEPROPS();
229 done:
230 UnlockEffectSlotsRead(context);
231 WriteUnlock(&context->PropLock);
232 ALCcontext_DecRef(context);
235 AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *values)
237 ALCcontext *context;
239 switch(param)
241 case AL_EFFECTSLOT_EFFECT:
242 case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
243 alAuxiliaryEffectSloti(effectslot, param, values[0]);
244 return;
247 context = GetContextRef();
248 if(!context) return;
250 LockEffectSlotsRead(context);
251 if(LookupEffectSlot(context, effectslot) == NULL)
252 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
253 switch(param)
255 default:
256 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
259 done:
260 UnlockEffectSlotsRead(context);
261 ALCcontext_DecRef(context);
264 AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat value)
266 ALCcontext *context;
267 ALeffectslot *slot;
269 context = GetContextRef();
270 if(!context) return;
272 WriteLock(&context->PropLock);
273 LockEffectSlotsRead(context);
274 if((slot=LookupEffectSlot(context, effectslot)) == NULL)
275 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
276 switch(param)
278 case AL_EFFECTSLOT_GAIN:
279 if(!(value >= 0.0f && value <= 1.0f))
280 SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
281 slot->Gain = value;
282 break;
284 default:
285 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
287 DO_UPDATEPROPS();
289 done:
290 UnlockEffectSlotsRead(context);
291 WriteUnlock(&context->PropLock);
292 ALCcontext_DecRef(context);
295 AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *values)
297 ALCcontext *context;
299 switch(param)
301 case AL_EFFECTSLOT_GAIN:
302 alAuxiliaryEffectSlotf(effectslot, param, values[0]);
303 return;
306 context = GetContextRef();
307 if(!context) return;
309 LockEffectSlotsRead(context);
310 if(LookupEffectSlot(context, effectslot) == NULL)
311 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
312 switch(param)
314 default:
315 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
318 done:
319 UnlockEffectSlotsRead(context);
320 ALCcontext_DecRef(context);
323 AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *value)
325 ALCcontext *context;
326 ALeffectslot *slot;
328 context = GetContextRef();
329 if(!context) return;
331 LockEffectSlotsRead(context);
332 if((slot=LookupEffectSlot(context, effectslot)) == NULL)
333 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
334 switch(param)
336 case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
337 *value = slot->AuxSendAuto;
338 break;
340 default:
341 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
344 done:
345 UnlockEffectSlotsRead(context);
346 ALCcontext_DecRef(context);
349 AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *values)
351 ALCcontext *context;
353 switch(param)
355 case AL_EFFECTSLOT_EFFECT:
356 case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
357 alGetAuxiliaryEffectSloti(effectslot, param, values);
358 return;
361 context = GetContextRef();
362 if(!context) return;
364 LockEffectSlotsRead(context);
365 if(LookupEffectSlot(context, effectslot) == NULL)
366 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
367 switch(param)
369 default:
370 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
373 done:
374 UnlockEffectSlotsRead(context);
375 ALCcontext_DecRef(context);
378 AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *value)
380 ALCcontext *context;
381 ALeffectslot *slot;
383 context = GetContextRef();
384 if(!context) return;
386 LockEffectSlotsRead(context);
387 if((slot=LookupEffectSlot(context, effectslot)) == NULL)
388 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
389 switch(param)
391 case AL_EFFECTSLOT_GAIN:
392 *value = slot->Gain;
393 break;
395 default:
396 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
399 done:
400 UnlockEffectSlotsRead(context);
401 ALCcontext_DecRef(context);
404 AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *values)
406 ALCcontext *context;
408 switch(param)
410 case AL_EFFECTSLOT_GAIN:
411 alGetAuxiliaryEffectSlotf(effectslot, param, values);
412 return;
415 context = GetContextRef();
416 if(!context) return;
418 LockEffectSlotsRead(context);
419 if(LookupEffectSlot(context, effectslot) == NULL)
420 SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
421 switch(param)
423 default:
424 SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
427 done:
428 UnlockEffectSlotsRead(context);
429 ALCcontext_DecRef(context);
433 static void RemoveEffectSlotList(ALCcontext *context, ALeffectslot *slot)
435 ALCdevice *device = context->Device;
436 ALeffectslot *root, *next;
438 root = slot;
439 next = ATOMIC_LOAD(&slot->next);
440 if(!ATOMIC_COMPARE_EXCHANGE_STRONG(ALeffectslot*, &context->ActiveAuxSlotList, &root, next))
442 ALeffectslot *cur;
443 do {
444 cur = root;
445 root = slot;
446 } while(!ATOMIC_COMPARE_EXCHANGE_STRONG(ALeffectslot*, &cur->next, &root, next));
448 /* Wait for any mix that may be using these effect slots to finish. */
449 while((ReadRef(&device->MixCount)&1) != 0)
450 althrd_yield();
454 void InitEffectFactoryMap(void)
456 InitUIntMap(&EffectStateFactoryMap, ~0);
458 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_NULL, ALnullStateFactory_getFactory);
459 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_EAXREVERB, ALreverbStateFactory_getFactory);
460 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_REVERB, ALreverbStateFactory_getFactory);
461 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_CHORUS, ALchorusStateFactory_getFactory);
462 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_COMPRESSOR, ALcompressorStateFactory_getFactory);
463 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_DISTORTION, ALdistortionStateFactory_getFactory);
464 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_ECHO, ALechoStateFactory_getFactory);
465 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_EQUALIZER, ALequalizerStateFactory_getFactory);
466 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_FLANGER, ALflangerStateFactory_getFactory);
467 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_RING_MODULATOR, ALmodulatorStateFactory_getFactory);
468 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_DEDICATED_DIALOGUE, ALdedicatedStateFactory_getFactory);
469 InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT, ALdedicatedStateFactory_getFactory);
472 void DeinitEffectFactoryMap(void)
474 ResetUIntMap(&EffectStateFactoryMap);
478 ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *effect)
480 ALenum newtype = (effect ? effect->type : AL_EFFECT_NULL);
481 struct ALeffectslotProps *props;
482 ALeffectState *State;
484 if(newtype != EffectSlot->Effect.Type)
486 ALeffectStateFactory *factory;
487 FPUCtl oldMode;
489 factory = getFactoryByType(newtype);
490 if(!factory)
492 ERR("Failed to find factory for effect type 0x%04x\n", newtype);
493 return AL_INVALID_ENUM;
495 State = V0(factory,create)();
496 if(!State) return AL_OUT_OF_MEMORY;
498 SetMixerFPUMode(&oldMode);
499 almtx_lock(&Device->BackendLock);
500 State->OutBuffer = Device->Dry.Buffer;
501 State->OutChannels = Device->Dry.NumChannels;
502 if(V(State,deviceUpdate)(Device) == AL_FALSE)
504 almtx_unlock(&Device->BackendLock);
505 RestoreFPUMode(&oldMode);
506 ALeffectState_DecRef(State);
507 return AL_OUT_OF_MEMORY;
509 almtx_unlock(&Device->BackendLock);
510 RestoreFPUMode(&oldMode);
512 if(!effect)
514 EffectSlot->Effect.Type = AL_EFFECT_NULL;
515 memset(&EffectSlot->Effect.Props, 0, sizeof(EffectSlot->Effect.Props));
517 else
519 EffectSlot->Effect.Type = effect->type;
520 EffectSlot->Effect.Props = effect->Props;
523 ALeffectState_DecRef(EffectSlot->Effect.State);
524 EffectSlot->Effect.State = State;
526 else if(effect)
527 EffectSlot->Effect.Props = effect->Props;
529 /* Remove state references from old effect slot property updates. */
530 props = ATOMIC_LOAD(&EffectSlot->FreeList);
531 while(props)
533 State = ATOMIC_EXCHANGE(ALeffectState*, &props->State, NULL, almemory_order_relaxed);
534 if(State) ALeffectState_DecRef(State);
535 props = ATOMIC_LOAD(&props->next, almemory_order_relaxed);
538 return AL_NO_ERROR;
542 static void ALeffectState_IncRef(ALeffectState *state)
544 uint ref;
545 ref = IncrementRef(&state->Ref);
546 TRACEREF("%p increasing refcount to %u\n", state, ref);
549 static void ALeffectState_DecRef(ALeffectState *state)
551 uint ref;
552 ref = DecrementRef(&state->Ref);
553 TRACEREF("%p decreasing refcount to %u\n", state, ref);
554 if(ref == 0) DELETE_OBJ(state);
558 void ALeffectState_Construct(ALeffectState *state)
560 InitRef(&state->Ref, 1);
562 state->OutBuffer = NULL;
563 state->OutChannels = 0;
566 void ALeffectState_Destruct(ALeffectState *UNUSED(state))
571 ALenum InitEffectSlot(ALeffectslot *slot)
573 ALeffectStateFactory *factory;
575 slot->Effect.Type = AL_EFFECT_NULL;
577 factory = getFactoryByType(AL_EFFECT_NULL);
578 if(!(slot->Effect.State=V0(factory,create)()))
579 return AL_OUT_OF_MEMORY;
581 slot->NeedsUpdate = AL_FALSE;
582 slot->Gain = 1.0;
583 slot->AuxSendAuto = AL_TRUE;
584 InitRef(&slot->ref, 0);
586 ATOMIC_INIT(&slot->Update, NULL);
587 ATOMIC_INIT(&slot->FreeList, NULL);
589 slot->Params.Gain = 1.0f;
590 slot->Params.AuxSendAuto = AL_TRUE;
591 ALeffectState_IncRef(slot->Effect.State);
592 slot->Params.EffectState = slot->Effect.State;
593 slot->Params.RoomRolloff = 0.0f;
594 slot->Params.DecayTime = 0.0f;
595 slot->Params.AirAbsorptionGainHF = 1.0f;
597 ATOMIC_INIT(&slot->next, NULL);
599 return AL_NO_ERROR;
602 void DeinitEffectSlot(ALeffectslot *slot)
604 struct ALeffectslotProps *props;
605 ALeffectState *state;
606 size_t count = 0;
608 props = ATOMIC_LOAD(&slot->Update);
609 if(props)
611 state = ATOMIC_LOAD(&props->State, almemory_order_relaxed);
612 if(state) ALeffectState_DecRef(state);
613 TRACE("Freed unapplied AuxiliaryEffectSlot update %p\n", props);
614 al_free(props);
616 props = ATOMIC_LOAD(&slot->FreeList, almemory_order_relaxed);
617 while(props)
619 struct ALeffectslotProps *next;
620 state = ATOMIC_LOAD(&props->State, almemory_order_relaxed);
621 next = ATOMIC_LOAD(&props->next, almemory_order_relaxed);
622 if(state) ALeffectState_DecRef(state);
623 al_free(props);
624 props = next;
625 ++count;
627 TRACE("Freed "SZFMT" AuxiliaryEffectSlot property object%s\n", count, (count==1)?"":"s");
629 ALeffectState_DecRef(slot->Effect.State);
630 if(slot->Params.EffectState)
631 ALeffectState_DecRef(slot->Params.EffectState);
634 void UpdateEffectSlotProps(ALeffectslot *slot)
636 struct ALeffectslotProps *props;
637 ALeffectState *oldstate;
639 /* Get an unused property container, or allocate a new one as needed. */
640 props = ATOMIC_LOAD(&slot->FreeList, almemory_order_relaxed);
641 if(!props)
642 props = al_calloc(16, sizeof(*props));
643 else
645 struct ALeffectslotProps *next;
646 do {
647 next = ATOMIC_LOAD(&props->next, almemory_order_relaxed);
648 } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALeffectslotProps*,
649 &slot->FreeList, &props, next, almemory_order_seq_cst,
650 almemory_order_consume) == 0);
653 /* Copy in current property values. */
654 ATOMIC_STORE(&props->Gain, slot->Gain, almemory_order_relaxed);
655 ATOMIC_STORE(&props->AuxSendAuto, slot->AuxSendAuto, almemory_order_relaxed);
657 ATOMIC_STORE(&props->Type, slot->Effect.Type, almemory_order_relaxed);
658 props->Props = slot->Effect.Props;
659 /* Swap out any stale effect state object there may be in the container, to
660 * delete it.
662 ALeffectState_IncRef(slot->Effect.State);
663 oldstate = ATOMIC_EXCHANGE(ALeffectState*, &props->State, slot->Effect.State,
664 almemory_order_relaxed);
666 /* Set the new container for updating internal parameters. */
667 props = ATOMIC_EXCHANGE(struct ALeffectslotProps*, &slot->Update, props,
668 almemory_order_acq_rel);
669 if(props)
671 /* If there was an unused update container, put it back in the
672 * freelist.
674 struct ALeffectslotProps *first = ATOMIC_LOAD(&slot->FreeList);
675 do {
676 ATOMIC_STORE(&props->next, first, almemory_order_relaxed);
677 } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALeffectslotProps*,
678 &slot->FreeList, &first, props) == 0);
681 if(oldstate)
682 ALeffectState_DecRef(oldstate);
685 void UpdateAllEffectSlotProps(ALCcontext *context)
687 ALeffectslot *slot;
689 LockEffectSlotsRead(context);
690 slot = ATOMIC_LOAD(&context->ActiveAuxSlotList);
691 while(slot)
693 if(slot->NeedsUpdate)
694 UpdateEffectSlotProps(slot);
695 slot->NeedsUpdate = AL_FALSE;
696 slot = ATOMIC_LOAD(&slot->next, almemory_order_relaxed);
698 UnlockEffectSlotsRead(context);
701 ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context)
703 ALsizei pos;
704 for(pos = 0;pos < Context->EffectSlotMap.size;pos++)
706 ALeffectslot *temp = Context->EffectSlotMap.values[pos];
707 Context->EffectSlotMap.values[pos] = NULL;
709 DeinitEffectSlot(temp);
711 FreeThunkEntry(temp->id);
712 memset(temp, 0, sizeof(ALeffectslot));
713 al_free(temp);