fix race between EventBase and EventBaseLocal dtors
Summary: EventBase keeps a registry of EventBaseLocal instances.EventBaseLocal keeps a registry of EventBase instances. At destruction time, both are trying to remove themselves from the other's registry, and it is possible that dtors are racing each other. There are two changes to address the race: 1. remove virtual method in EventBaseLocal because calling through vptr makes TSAN unhappy - the underlying vtbl is being mutated during destruction. 2. Since deregistration involves acquiring two locks, a lock inversion must be avoided. This is achieved by retrying if inner lock acquisition has failed. Reviewed By: andriigrynenko Differential Revision: D29120201 fbshipit-source-id: 93c93c8d7cc7126e3432ac06562d55a838008e4a
Showing
Please register or sign in to comment