X-Git-Url: http://git.liburcu.org/?p=userspace-rcu.git;a=blobdiff_plain;f=urcu.c;h=ba013d990b6f052da8e85f69af7192de72a4b799;hp=2339bc63c872c6a4826d7a52e8d064d85130c0df;hb=refs%2Fheads%2Fstable-0.6;hpb=6d841bc23fc94345fe76651d73c1a3f821a85aa7 diff --git a/urcu.c b/urcu.c index 2339bc6..ba013d9 100644 --- a/urcu.c +++ b/urcu.c @@ -25,6 +25,7 @@ #define _BSD_SOURCE #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include @@ -35,11 +36,27 @@ #include #include +#include "urcu/wfqueue.h" #include "urcu/map/urcu.h" - #include "urcu/static/urcu.h" +#include "urcu-pointer.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; @@ -127,7 +144,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) #ifdef RCU_MEMBARRIER static void smp_mb_master(int group) { - if (likely(has_sys_membarrier)) + if (caa_likely(has_sys_membarrier)) membarrier(MEMBARRIER_EXPEDITED); else cmm_smp_mb();