Fix: tests: invoke destroy APIs for queues/stacks
[urcu.git] / urcu-pointer.c
index 83f0ffdacb388cdc87016a9a10408fe7b712e62d..61e35da5d718a05dc0f8fad69b0aeb370c7c1d66 100644 (file)
@@ -4,7 +4,7 @@
  *
  * library wrappers to be used by non-LGPL compatible source code.
  *
- * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
  *
  * This library is free software; you can redistribute it and/or
@@ -24,9 +24,9 @@
  * IBM's contributions to this file may be relicensed under LGPLv2 or later.
  */
 
-#include <urcu/uatomic_arch.h>
+#include <urcu/uatomic.h>
 
-#include "urcu-pointer-static.h"
+#include "urcu/static/urcu-pointer.h"
 /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
 #include "urcu-pointer.h"
 
@@ -39,22 +39,19 @@ void *rcu_dereference_sym(void *p)
 
 void *rcu_set_pointer_sym(void **p, void *v)
 {
-       wmb();
-       return STORE_SHARED(*p, v);
+       cmm_wmb();
+       uatomic_set(p, v);
+       return v;
 }
 
 void *rcu_xchg_pointer_sym(void **p, void *v)
 {
-       wmb();
+       cmm_wmb();
        return uatomic_xchg(p, v);
 }
 
 void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new)
 {
-       wmb();
-       if (likely(URCU_CAS_AVAIL()))
-               return uatomic_cmpxchg(p, old, _new);
-
-       /* Compatibility for i386. Old-timer. */
-       return compat_uatomic_cmpxchg(p, old, _new);
+       cmm_wmb();
+       return uatomic_cmpxchg(p, old, _new);
 }
This page took 0.023081 seconds and 4 git commands to generate.