X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu-qsbr.c;h=1dc99792d7a49f2f6f3614693e34cde239312bfb;hp=8d8a9cf05ced0fd18ef9943110dc22a2e6e05e87;hb=a128aeb4a7b1a05c9ddbc8b0239c93ca00984f4a;hpb=83a2c42177d2b28890bc3674d30f9ed5f8edb0a8 diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 8d8a9cf..1dc9979 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -24,6 +24,7 @@ */ #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include @@ -34,12 +35,15 @@ #include #include +#include "urcu/wfqueue.h" #include "urcu/map/urcu-qsbr.h" - #define BUILD_QSBR_LIB #include "urcu/static/urcu-qsbr.h" + /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ +#undef _LGPL_SOURCE #include "urcu-qsbr.h" +#define _LGPL_SOURCE void __attribute__((destructor)) rcu_exit(void); @@ -214,8 +218,11 @@ void synchronize_rcu(void) * our own quiescent state. This allows using synchronize_rcu() * in threads registered as readers. */ - if (was_online) + if (was_online) { CMM_STORE_SHARED(rcu_reader.ctr, 0); + cmm_smp_mb(); /* write rcu_reader.ctr before read futex */ + wake_up_gp(); + } mutex_lock(&rcu_gp_lock); @@ -273,8 +280,11 @@ void synchronize_rcu(void) * in threads registered as readers. */ cmm_smp_mb(); - if (was_online) + if (was_online) { CMM_STORE_SHARED(rcu_reader.ctr, 0); + cmm_smp_mb(); /* write rcu_reader.ctr before read futex */ + wake_up_gp(); + } mutex_lock(&rcu_gp_lock); if (cds_list_empty(®istry))