mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 06:45:59 +00:00
Updated the atomic API for SDL 3.0 naming conventions
Fixes https://github.com/libsdl-org/SDL/issues/7388
This commit is contained in:
@@ -635,7 +635,7 @@ void SDL_AudioDeviceDisconnected(SDL_AudioDevice *device)
|
||||
const SDL_bool is_default_device = ((devid == current_audio.default_output_device_id) || (devid == current_audio.default_capture_device_id));
|
||||
SDL_UnlockRWLock(current_audio.device_hash_lock);
|
||||
|
||||
const SDL_bool first_disconnect = SDL_AtomicCAS(&device->zombie, 0, 1);
|
||||
const SDL_bool first_disconnect = SDL_AtomicCompareAndSwap(&device->zombie, 0, 1);
|
||||
if (first_disconnect) { // if already disconnected this device, don't do it twice.
|
||||
// Swap in "Zombie" versions of the usual platform interfaces, so the device will keep
|
||||
// making progress until the app closes it. Otherwise, streams might continue to
|
||||
@@ -809,7 +809,7 @@ int SDL_InitAudio(const char *driver_name)
|
||||
}
|
||||
|
||||
// make sure device IDs start at 2 (because of SDL2 legacy interface), but don't reset the counter on each init, in case the app is holding an old device ID somewhere.
|
||||
SDL_AtomicCAS(&last_device_instance_id, 0, 2);
|
||||
SDL_AtomicCompareAndSwap(&last_device_instance_id, 0, 2);
|
||||
|
||||
SDL_ChooseAudioConverters();
|
||||
SDL_SetupAudioResampler();
|
||||
|
Reference in New Issue
Block a user