Fix a race in TLRefCount
Summary: After count_.store was done it's possible that the thread performing collect observed the value, and then it successfully decremented the counter to 0 and destroyed TLRefCount. The rest of the code in update method then couldn't safely assume that the TLRefCount object is still alive. This fixes collect to actually wait for update to complete (if we detect that we actually captured the new value written by such update). Reviewed By: davidtgoldblatt Differential Revision: D13696608 fbshipit-source-id: bd1a69ea3cc005b90ff481705fdffb83d8a9077a
Showing
Please register or sign in to comment