From: Rico Tzschichholz Date: Tue, 12 May 2020 05:28:29 +0000 (+0200) Subject: glib-2.0: Add AtomicUint, an alternation of AtomicInt for uint X-Git-Tag: 0.46.12~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f7a32520ffc031b1fefc9694c8f60d489ff9a5b;p=thirdparty%2Fvala.git glib-2.0: Add AtomicUint, an alternation of AtomicInt for uint Fixes https://gitlab.gnome.org/GNOME/vala/issues/915 --- diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index f6bbdc8f0..1cbd706df 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -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);