]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Add AtomicUint, an alternation of AtomicInt for uint
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 12 May 2020 05:28:29 +0000 (07:28 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 26 Jul 2020 08:38:00 +0000 (10:38 +0200)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/915

vapi/glib-2.0.vapi

index f6bbdc8f082cecbd109f445058dfd91464096a5a..1cbd706df50b4071dc665bd6b4a58e93ea1fc1ef 100644 (file)
@@ -1782,6 +1782,26 @@ namespace GLib {
                public static bool dec_and_test ([CCode (type = "volatile gint *")] ref int atomic);
        }
 
+       [Version (since = "2.4")]
+       namespace AtomicUint {
+               [CCode (cname = "g_atomic_int_get")]
+               public static uint get ([CCode (type = "volatile guint *")] ref uint atomic);
+               [CCode (cname = "g_atomic_int_set")]
+               public static void set ([CCode (type = "volatile guint *")] ref uint atomic, uint newval);
+               [Version (since = "2.30")]
+               [CCode (cname = "g_atomic_int_add")]
+               public static uint add ([CCode (type = "volatile guint *")] ref uint atomic, uint val);
+               [Version (deprecated_since = "2.30", replacement = "add")]
+               [CCode (cname = "g_atomic_int_exchange_and_add")]
+               public static uint exchange_and_add ([CCode (type = "volatile guint *")] ref uint atomic, uint val);
+               [CCode (cname = "g_atomic_int_compare_and_exchange")]
+               public static bool compare_and_exchange ([CCode (type = "volatile guint *")] ref uint atomic, uint oldval, uint newval);
+               [CCode (cname = "g_atomic_int_inc")]
+               public static void inc ([CCode (type = "volatile guint *")] ref uint atomic);
+               [CCode (cname = "g_atomic_int_dec_and_test")]
+               public static bool dec_and_test ([CCode (type = "volatile guint *")] ref uint atomic);
+       }
+
        [Version (since = "2.4")]
        namespace AtomicPointer {
                public static void* get ([CCode (type = "volatile gpointer *")] void** atomic);