mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-14 13:26:16 +01:00
bfdeb37f6e
Atomic primitives allow to do conditional compare and exchange but also to get the value that was previously stored in the atomic variable. Now, we provided an exchange function that allows to do an exchange if the atomic value matches an expected value but we had no way to know at the same time what was the value in the atomic at the moment of the exchange try, an this can be useful in case that the operation fails, for example if the current value is still acceptable for us, allowing to do a kind of "OR" check: gint old_value; gint valid_value = 222; while (!g_atomic_pointer_compare_and_exchange_value (&atomic, valid_value, 555, &old_value) { if (old_value == 555 || old_value == 222) valid_value = old_value; } |
||
---|---|---|
.. | ||
xml | ||
building.xml | ||
changes.xml | ||
compiling.xml | ||
cross.xml | ||
file-name-encodings.png | ||
file-name-encodings.sxd | ||
glib-docs.xml | ||
glib-gettextize.xml | ||
glib-overrides.txt | ||
glib-sections.txt | ||
gtester-report.xml | ||
gtester.xml | ||
gvariant-text.xml | ||
gvariant-varargs.xml | ||
mainloop-states.eps | ||
mainloop-states.fig | ||
mainloop-states.gif | ||
mainloop-states.png | ||
meson.build | ||
programming.xml | ||
regex-syntax.xml | ||
resources.xml | ||
running.xml | ||
Sorted_binary_tree_breadth-first_traversal.svg | ||
Sorted_binary_tree_inorder.svg | ||
Sorted_binary_tree_postorder.svg | ||
Sorted_binary_tree_preorder.svg | ||
version.xml.in |