Cameron Gutman 97c154791b atomic: Fix missing full memory barrier on GCC/Clang
__sync_lock_test_and_set() is designed for creating locks, not as
a general atomic exchange function. As a result, it only provides
an acquire memory barrier and isn't guaranteed to actually store
the provided value (though it does on architectures we care about).

__atomic_exchange_n() is supported on GCC/Clang for the last ~10
years, so let's use that instead if available. We will keep the
__sync_lock_test_and_set() fallback around for ancient platforms,
but add a full memory barrier to match the documented behavior.

(cherry picked from commit 509a36db16)
2026-04-19 06:55:12 -04:00
2025-01-13 16:42:50 -08:00
2025-01-13 16:42:50 -08:00
2025-03-06 16:25:17 -08:00
2026-01-01 09:48:19 -08:00
2025-11-16 01:15:10 +03:00

Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.

You can find the latest release and additional information at: https://www.libsdl.org/

Installation instructions and a quick introduction is available in INSTALL.md

This library is distributed under the terms of the zlib license, available in LICENSE.txt.

Enjoy!

Sam Lantinga (slouken@libsdl.org)

Description
No description provided
Readme 212 MiB
Languages
C 85.7%
C++ 6.6%
Objective-C 3.4%
CMake 1.6%
Perl 0.7%
Other 1.7%