Fix a race on destruction of ScopedEventBaseThread
Summary: This diff fixes a race that happens on destruction of `ScopedEventBaseThread`. ``` Thread1: ~ScopedEventBaseThread() Thread1: eb_.terminateLoopSoon() <- preempted just after stop_ = true Thread2: eb->loopForever() in run(...) exits because stop_ is true Thread2: ... Thread2: eb->~EventBase() Thread1: queue_->putMessage(nullptr) <- accesses destroyed EventBase ``` Reviewed By: yfeldblum Differential Revision: D5042654 fbshipit-source-id: 95515ed7cde09ff5f125ef121bea86ab3907f98a
Showing
Please register or sign in to comment