+
+static void force_mb_single_thread(pthread_t tid)
+{
+ assert(reader_data);
+ sig_done = 0;
+ /*
+ * pthread_kill has a smp_mb(). But beware, we assume it performs
+ * a cache flush on architectures with non-coherent cache. Let's play
+ * safe and don't assume anything : we use smp_mc() to make sure the
+ * cache flush is enforced.
+ * smp_mb(); write sig_done before sending the signals
+ */
+ smp_mc(); /* 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 (LOAD_SHARED(sig_done) < 1)
+ cpu_relax();
+ smp_mb(); /* read sig_done before ending the barrier */
+}
+