Add -Wextra to CFLAGS
[urcu.git] / tests / regression / rcutorture.h
index 7de182f5db4025ad87effd3184c8b0d10bfdce55..9a2f9a1f581ffc5c34e4ce0c5f2ed2a12e114b75 100644 (file)
@@ -113,13 +113,13 @@ volatile int goflag __attribute__((__aligned__(CAA_CACHE_LINE_SIZE)))
 #endif
 
 #ifndef mark_rcu_quiescent_state
-#define mark_rcu_quiescent_state() do ; while (0)
+#define mark_rcu_quiescent_state() do {} while (0)
 #endif /* #ifdef mark_rcu_quiescent_state */
 
 #ifndef put_thread_offline
-#define put_thread_offline()           do ; while (0)
-#define put_thread_online()            do ; while (0)
-#define put_thread_online_delay()      do ; while (0)
+#define put_thread_offline()           do {} while (0)
+#define put_thread_online()            do {} while (0)
+#define put_thread_online_delay()      do {} while (0)
 #else /* #ifndef put_thread_offline */
 #define put_thread_online_delay()      synchronize_rcu()
 #endif /* #else #ifndef put_thread_offline */
@@ -396,7 +396,23 @@ void *rcu_update_stress_test(void *arg)
                                        strerror(errno));
                                abort();
                        }
+                       rcu_register_thread();
                        call_rcu(&rh, rcu_update_stress_test_rcu);
+                       rcu_unregister_thread();
+                       /*
+                        * Our MacOS X test machine with the following
+                        * config:
+                        * 15.6.0 Darwin Kernel Version 15.6.0
+                        * root:xnu-3248.60.10~1/RELEASE_X86_64
+                        * appears to have issues with liburcu-signal
+                        * signal being delivered on top of
+                        * pthread_cond_wait. It seems to make the
+                        * thread continue, and therefore corrupt the
+                        * rcu_head. Work around this issue by
+                        * unregistering the RCU read-side thread
+                        * immediately after call_rcu (call_rcu needs
+                        * us to be registered RCU readers).
+                        */
                        ret = pthread_cond_wait(&call_rcu_test_cond,
                                        &call_rcu_test_mutex);
                        if (ret) {
@@ -415,6 +431,7 @@ void *rcu_update_stress_test(void *arg)
                }
                n_updates++;
        }
+
        return NULL;
 }
 
@@ -531,7 +548,7 @@ int main(int argc, char *argv[])
                        goto end;
                }
        }
-       
+
        switch (callrcu_type) {
        case CALLRCU_GLOBAL:
                diag("Using global per-process call_rcu thread.");
This page took 0.02347 seconds and 4 git commands to generate.