*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <stdio.h>
#include <pthread.h>
#include <signal.h>
#include <errno.h>
#include <poll.h>
+#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);
* 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);
* 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))