folly/synchronization/LifoSem: fixed race condition between tryRemoveNode and...
folly/synchronization/LifoSem: fixed race condition between tryRemoveNode and shutdown by checking the lock in shutdown (#989) Summary: Pull Request resolved: https://github.com/facebook/folly/pull/989 Original post: https://fb.workplace.com/groups/560979627394613/permalink/1370192126473355/ There was a bug where we weren't checking the isLocked bit when setting the isShutdown bit. Thus, tryRemoveNode would acquire the lock, shutdown would set the shutdown bit, and then tryRemoveNode would release the lock via a direct store which accidentally cleared the shutdown bit. The new code wait loops in shutdown until the lock is cleared. Reviewed By: yfeldblum, djwatson Differential Revision: D13586264 fbshipit-source-id: 52139df8d7880a60039b6dab810898e0546479dc
Showing
Please register or sign in to comment