Fix deadlock in TimedMutex
authorMatthew Tolton <mtolton@fb.com>
Sat, 23 Sep 2017 00:32:21 +0000 (17:32 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 23 Sep 2017 00:35:07 +0000 (17:35 -0700)
commit47d37c8e3d1b861615596283f4483fac33cbcf61
tree16ecbe2562aaa23cd6dc2a71b3a4a7ea52803e33
parentaee7113e8140c5b873c56be29a429acdbb9a5268
Fix deadlock in TimedMutex

Summary:
If a lock is stolen from fiber f1, and then fiber f2 is notified before f1 one
wakes up and discovers the crime, then f1 will clear notifiedFiber_ so that f2
thinks the lock was stolen from it as well and hence recurses back into lock().

Reviewed By: andriigrynenko

Differential Revision: D5896323

fbshipit-source-id: 528ec1ed983175d3e08f3dc07b69bbc783a86cfb
folly/fibers/TimedMutex-inl.h
folly/fibers/test/FibersTest.cpp