add rcu_cmpxchg_pointer
[urcu.git] / urcu.c
diff --git a/urcu.c b/urcu.c
index 07537efbc55c90943b49f1a240aab5935fc55bc7..a8f85c6f02199d4ecdfb20b1a0098cef213c138c 100644 (file)
--- a/urcu.c
+++ b/urcu.c
@@ -45,9 +45,9 @@ void urcu_init(void)
 }
 #endif
 
-int init_done;
+static int init_done;
 
-pthread_mutex_t urcu_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t urcu_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 /*
  * Global grace period counter.
@@ -81,7 +81,7 @@ static struct reader_registry *registry;
 static char __thread need_mb;
 static int num_readers, alloc_readers;
 
-void internal_urcu_lock(void)
+static void internal_urcu_lock(void)
 {
        int ret;
 
@@ -108,7 +108,7 @@ void internal_urcu_lock(void)
 #endif /* #else #ifndef DISTRUST_SIGNALS_EXTREME */
 }
 
-void internal_urcu_unlock(void)
+static void internal_urcu_unlock(void)
 {
        int ret;
 
@@ -347,6 +347,12 @@ void *rcu_xchg_pointer_sym(void **p, void *v)
        return xchg(p, v);
 }
 
+void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new)
+{
+       wmb();
+       return cmpxchg(p, old, _new);
+}
+
 void *rcu_publish_content_sym(void **p, void *v)
 {
        void *oldptr;
This page took 0.022529 seconds and 4 git commands to generate.