Renamed atomic functions to match SDL 3.0 naming convention

This will also allow us to cleanly add atomic operations for other types in the future.
This commit is contained in:
Sam Lantinga
2024-09-16 23:21:31 -07:00
parent f3e419596b
commit 8d223b3037
64 changed files with 496 additions and 472 deletions

View File

@@ -86,7 +86,7 @@ void SDL_UnlockSensors(void)
if (!SDL_sensors_initialized) {
// NOTE: There's a small window here where another thread could lock the mutex after we've checked for pending locks
if (!SDL_sensors_locked && SDL_AtomicGet(&SDL_sensor_lock_pending) == 0) {
if (!SDL_sensors_locked && SDL_GetAtomicInt(&SDL_sensor_lock_pending) == 0) {
last_unlock = true;
}
}

View File

@@ -67,7 +67,7 @@ static int SDLCALL SDL_ANDROID_SensorThread(void *data)
SDL_sensor_looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
SDL_SignalSemaphore(ctx->sem);
while (SDL_AtomicGet(&ctx->running)) {
while (SDL_GetAtomicInt(&ctx->running)) {
Uint64 timestamp = SDL_GetTicksNS();
if (ALooper_pollOnce(-1, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
@@ -93,7 +93,7 @@ static int SDLCALL SDL_ANDROID_SensorThread(void *data)
static void SDL_ANDROID_StopSensorThread(SDL_AndroidSensorThreadContext *ctx)
{
SDL_AtomicSet(&ctx->running, false);
SDL_SetAtomicInt(&ctx->running, false);
if (ctx->thread) {
int result;
@@ -119,7 +119,7 @@ static bool SDL_ANDROID_StartSensorThread(SDL_AndroidSensorThreadContext *ctx)
return false;
}
SDL_AtomicSet(&ctx->running, true);
SDL_SetAtomicInt(&ctx->running, true);
ctx->thread = SDL_CreateThread(SDL_ANDROID_SensorThread, "Sensors", ctx);
if (!ctx->thread) {
SDL_ANDROID_StopSensorThread(ctx);