X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu.c;h=be6d4bdfc55b32d624011280c972d6f2772f2853;hb=34b1b9db1cc283c556af5f35f70ea2e4713a440d;hp=ccaf3e95a2d5ad6f7428625b399429cd843344b6;hpb=af7c2dbeac32c663b64ad05e4eca70e18784463b;p=urcu.git diff --git a/urcu.c b/urcu.c index ccaf3e9..be6d4bd 100644 --- a/urcu.c +++ b/urcu.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,18 @@ /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ #include "urcu.h" +/* + * 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; int has_sys_membarrier; @@ -62,7 +75,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.