+
+static void force_mb_single_thread(pthread_t tid)
+{
+ assert(reader_data);
+ sig_done = 0;
+ smp_mb(); /* write sig_done before sending the signals */
+ pthread_kill(tid, SIGURCU);
+ /*
+ * Wait for sighandler (and thus mb()) to execute on every thread.
+ * BUSY-LOOP.
+ */
+ while (sig_done < 1)
+ smp_rmb(); /* ensure we re-read sig-done */
+ smp_mb(); /* read sig_done before ending the barrier */
+}
+