2.0 beta init
[framework/multimedia/gstreamer0.10.git] / gst / gstatomicqueue.c
index 31ac770..5b21be6 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <gst/gst.h>
 #include "gstatomicqueue.h"
+#include "glib-compat-private.h"
 
 /**
  * SECTION:gstatomicqueue
@@ -112,8 +113,8 @@ add_to_free_list (GstAtomicQueue * queue, GstAQueueMem * mem)
 {
   do {
     mem->free = g_atomic_pointer_get (&queue->free_list);
-  } while (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
-          queue->free_list, mem->free, mem));
+  } while (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->free_list,
+          mem->free, mem));
 }
 
 static void
@@ -126,8 +127,8 @@ clear_free_list (GstAtomicQueue * queue)
     free_list = g_atomic_pointer_get (&queue->free_list);
     if (free_list == NULL)
       return;
-  } while (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
-          queue->free_list, free_list, NULL));
+  } while (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->free_list, free_list,
+          NULL));
 
   while (free_list) {
     GstAQueueMem *next = free_list->free;
@@ -247,8 +248,8 @@ gst_atomic_queue_peek (GstAtomicQueue * queue)
 
     /* now we try to move the next array as the head memory. If we fail to do that,
      * some other reader managed to do it first and we retry */
-    if (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
-            queue->head_mem, head_mem, next))
+    if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->head_mem, head_mem,
+            next))
       continue;
 
     /* when we managed to swing the head pointer the old head is now
@@ -304,8 +305,8 @@ gst_atomic_queue_pop (GstAtomicQueue * queue)
 
       /* now we try to move the next array as the head memory. If we fail to do that,
        * some other reader managed to do it first and we retry */
-      if (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
-              queue->head_mem, head_mem, next))
+      if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->head_mem, head_mem,
+              next))
         continue;
 
       /* when we managed to swing the head pointer the old head is now
@@ -362,8 +363,8 @@ gst_atomic_queue_push (GstAtomicQueue * queue, gpointer data)
       mem = new_queue_mem ((size << 1) + 1, tail);
 
       /* try to make our new array visible to other writers */
-      if (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
-              queue->tail_mem, tail_mem, mem)) {
+      if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->tail_mem, tail_mem,
+              mem)) {
         /* we tried to swap the new writer array but something changed. This is
          * because some other writer beat us to it, we free our memory and try
          * again */