mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-13 12:37:46 +02:00
.gitlab-ci
.reuse
LICENSES
docs
reference
gio
glib
gobject
.gitignore
AUTHORS
COPYING
NEWS
meson.build
CODEOWNERS
backports.md
debugging.txt
macros.txt
meson-version.md
rationales.md
roadmap.md
supported-platforms.md
toolchain-requirements.md
fuzzing
gio
glib
gmodule
gobject
gthread
m4macros
po
subprojects
tests
tools
.clang-format
.dir-locals.el
.editorconfig
.gitignore
.gitlab-ci.yml
.lcovrc
CODE_OF_CONDUCT.md
CONTRIBUTING.md
COPYING
HACKING
INSTALL.md
NEWS
README.md
README.win32.md
SECURITY.md
glib.doap
meson.build
meson_options.txt
msvc_recommended_pragmas.h
Atomic APIs provide a way to exchange values only if we compare a value that is equal to the old value, but not to just exchange the value returning the old one. However, compilers provide such built-in functions, so we can use them to expose such functionality to GLib. The only drawback is that when using an old version of gcc not providing atomic APIs to swap values, we need to re-implement it with an implementation that may not be fully atomic, but that is safe enough. However this codepath should really not be used currently as gcc introduced __atomic_exchange_n() at version 4.7.4, so 8 years ago.