facebook/folly

Some RCU tests call `rcu_synchronize()` but expect `rcu_barrier()` effects

Opened this issue · 0 comments

Some RCU tests assert that deleters have run. For example, RcuTest.Guard (where setting del to true is a side effect of foo's destructor):

rcu_retire(foo);
rcu_synchronize();
EXPECT_TRUE(del);

According to Rcu.h, the purpose of rcu_synchronize() is to wait for all pre-existing readers to finish. The function that "waits for all in-flight deleters to complete" is rcu_barrier(). Since the test expects foo's deleter to have run, it should call rcu_barrier().

I believe this applies to the following RcuTest tests:

  • Guard
  • NewDomainGuardTest
  • ThreadDeath
  • RcuObjBase