From: Juerg Billeter Date: Wed, 28 Nov 2007 16:05:33 +0000 (+0000) Subject: bind atomic operations, fixes bug 499970 X-Git-Tag: VALA_0_1_6~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c63149884fb6883646bbeb7bd4befdf67592adfd;p=thirdparty%2Fvala.git bind atomic operations, fixes bug 499970 2007-11-28 Juerg Billeter * vapi/glib-2.0.vapi: bind atomic operations, fixes bug 499970 svn path=/trunk/; revision=733 --- diff --git a/ChangeLog b/ChangeLog index 4433fa125..4f5778b43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-11-28 Jürg Billeter + + * vapi/glib-2.0.vapi: bind atomic operations, fixes bug 499970 + 2007-11-28 Jürg Billeter * vala/parser.y, vala/scanner.l, vala/valafield.vala, diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 6d34c6b25..b96d7ca6e 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -981,6 +981,24 @@ namespace GLib { public static float scalbf (float x, float n); } + /* Atomic Operations */ + + public static class 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 class AtomicPointer { + public static pointer get (ref pointer atomic); + public static void set (ref pointer atomic, pointer newval); + public static bool compare_and_exchange (ref pointer atomic, pointer oldval, pointer newval); + } + /* The Main Event Loop */ [CCode (ref_function = "g_main_loop_ref", unref_function = "g_main_loop_unref")]