perror("Error in pthread mutex lock");
exit(-1);
}
- if (rcu_reader.need_mb) {
+ if (LOAD_SHARED(rcu_reader.need_mb)) {
smp_mb();
- rcu_reader.need_mb = 0;
+ _STORE_SHARED(rcu_reader.need_mb, 0);
smp_mb();
}
poll(NULL,0,10);
* cache flush is enforced.
*/
list_for_each_entry(index, ®istry, head) {
- index->need_mb = 1;
- smp_mc(); /* write need_mb before sending the signal */
+ STORE_SHARED(index->need_mb, 1);
pthread_kill(index->tid, SIGRCU);
}
/*
* the Linux Test Project (LTP).
*/
list_for_each_entry(index, ®istry, head) {
- while (index->need_mb) {
+ while (LOAD_SHARED(index->need_mb)) {
pthread_kill(index->tid, SIGRCU);
poll(NULL, 0, 1);
}
* executed on.
*/
smp_mb();
- rcu_reader.need_mb = 0;
+ _STORE_SHARED(rcu_reader.need_mb, 0);
smp_mb();
}