urcu call_rcu: Use RCU read-side protection for per-cpu call_rcu data
[urcu.git] / urcu.c
diff --git a/urcu.c b/urcu.c
index d356f54648d551b44316d8d11cbeb09cf7c9b84d..77f6888f0ec547647fe8ced21e04d19e4de73105 100644 (file)
--- a/urcu.c
+++ b/urcu.c
  */
 
 #define _BSD_SOURCE
+#define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <stdio.h>
 #include <pthread.h>
 #include <signal.h>
 #include <assert.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <string.h>
 #include <errno.h>
 #include <poll.h>
 
-#include "urcu-map.h"
+#include "urcu/wfqueue.h"
+#include "urcu/map/urcu.h"
+#include "urcu/static/urcu.h"
+#include "urcu-pointer.h"
 
-#include "urcu-static.h"
 /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
+#undef _LGPL_SOURCE
 #include "urcu.h"
+#define _LGPL_SOURCE
+
+/*
+ * If a reader is really non-cooperative and refuses to commit its
+ * rcu_active_readers count to memory (there is no barrier in the reader
+ * per-se), kick it after a few loops waiting for it.
+ */
+#define KICK_READER_LOOPS 10000
+
+/*
+ * Active attempts to check for reader Q.S. before calling futex().
+ */
+#define RCU_QS_ACTIVE_ATTEMPTS 100
 
 #ifdef RCU_MEMBARRIER
 static int init_done;
@@ -61,7 +80,7 @@ void __attribute__((destructor)) rcu_exit(void);
 
 static pthread_mutex_t rcu_gp_lock = PTHREAD_MUTEX_INITIALIZER;
 
-int gp_futex;
+int32_t gp_futex;
 
 /*
  * Global grace period counter.
This page took 0.024513 seconds and 4 git commands to generate.