Change API
[urcu.git] / urcu.h
diff --git a/urcu.h b/urcu.h
index 3c5b178d1a8254adb37331fea6b61698a58c459c..b6b5c7b039e359225d947afb91a29a2f25ba6a3c 100644 (file)
--- a/urcu.h
+++ b/urcu.h
@@ -77,40 +77,30 @@ static inline int get_urcu_qparity(void)
 }
 
 /*
- * returns urcu_parity.
+ * urcu_parity should be declared on the caller's stack.
  */
-static inline int rcu_read_lock(void)
+static inline void rcu_read_lock(int *urcu_parity)
 {
-       int urcu_parity = get_urcu_qparity();
-       urcu_active_readers[urcu_parity]++;
+       *urcu_parity = get_urcu_qparity();
+       urcu_active_readers[*urcu_parity]++;
        /*
         * Increment active readers count before accessing the pointer.
         * See force_mb_all_threads().
         */
        barrier();
-       return urcu_parity;
 }
 
-static inline void rcu_read_unlock(int urcu_parity)
+static inline void rcu_read_unlock(int *urcu_parity)
 {
        barrier();
        /*
         * Finish using rcu before decrementing the pointer.
         * See force_mb_all_threads().
         */
-       urcu_active_readers[urcu_parity]--;
+       urcu_active_readers[*urcu_parity]--;
 }
 
-extern void rcu_write_lock(void);
-extern void rcu_write_unlock(void);
-
-extern void *_urcu_publish_content(void **ptr, void *new);
-
-/*
- * gcc does not like automatic &struct ... * -> void **.
- * Remove the warning. (hopefully this is ok)
- */
-#define urcu_publish_content(ptr, new) _urcu_publish_content((void **)ptr, new)
+extern void *urcu_publish_content(void **ptr, void *new);
 
 /*
  * Reader thread registration.
This page took 0.024566 seconds and 4 git commands to generate.