]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Ensure to use volatile modifier for atomic operations
authorJürg Billeter <j@bitron.ch>
Fri, 12 Aug 2011 09:03:47 +0000 (11:03 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 12 Aug 2011 14:19:28 +0000 (16:19 +0200)
vapi/glib-2.0.vapi

index f0ed5a9ffc78d841efe62c2fe3a8f494875fa687..59656857aa3f578f374edbb48160f2c5f0a52e07 100644 (file)
@@ -1607,19 +1607,19 @@ namespace GLib {
        /* Atomic Operations */
 
        namespace AtomicInt {
-               public static int get (ref int atomic);
-               public static void set (ref int atomic, int newval);
-               public static void add (ref int atomic, int val);
-               public static int exchange_and_add (ref int atomic, int val);
-               public static bool compare_and_exchange (ref int atomic, int oldval, int newval);
-               public static void inc (ref int atomic);
-               public static bool dec_and_test (ref int atomic);
+               public static int get ([CCode (type = "volatile gint *")] ref int atomic);
+               public static void set ([CCode (type = "volatile gint *")] ref int atomic, int newval);
+               public static void add ([CCode (type = "volatile gint *")] ref int atomic, int val);
+               public static int exchange_and_add ([CCode (type = "volatile gint *")] ref int atomic, int val);
+               public static bool compare_and_exchange ([CCode (type = "volatile gint *")] ref int atomic, int oldval, int newval);
+               public static void inc ([CCode (type = "volatile gint *")] ref int atomic);
+               public static bool dec_and_test ([CCode (type = "volatile gint *")] ref int atomic);
        }
 
        namespace AtomicPointer {
-               public static void* get (void** atomic);
-               public static void set (void** atomic, void* newval);
-               public static bool compare_and_exchange (void** atomic, void* oldval, void* newval);
+               public static void* get ([CCode (type = "volatile gpointer *")] void** atomic);
+               public static void set ([CCode (type = "volatile gpointer *")] void** atomic, void* newval);
+               public static bool compare_and_exchange ([CCode (type = "volatile gpointer *")] void** atomic, void* oldval, void* newval);
        }
 
        /* The Main Event Loop */