X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu.c;h=20bbf36727663b514405f6d49a3b97f422a20979;hb=53960c9f970e231b1ca5f53913b60d298540cf9a;hp=e529ac0d5168447cb690162217b7118990996cc1;hpb=6cf3827cf5809fbcee555fb08286ad756be42dad;p=urcu.git diff --git a/urcu.c b/urcu.c index e529ac0..20bbf36 100644 --- a/urcu.c +++ b/urcu.c @@ -24,18 +24,38 @@ */ #define _BSD_SOURCE +#define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include #include #include +#include #include #include #include -#include "urcu-static.h" +#include "urcu/wfqueue.h" +#include "urcu/map/urcu.h" +#include "urcu/static/urcu.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; @@ -59,7 +79,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. @@ -428,4 +448,8 @@ void rcu_exit(void) assert(act.sa_sigaction == sigrcu_handler); assert(cds_list_empty(®istry)); } + #endif /* #ifdef RCU_SIGNAL */ + +#include "urcu-call-rcu-impl.h" +#include "urcu-defer-impl.h"