Add eligible-for-elision accessors to folly::SharedMutex.
Summary: Lock elision requires non-mutating functions that check if lock acquisition could succeed. This diff adds such functions to folly::SharedMutex, including eligible_for_lock_elision(), eligible_for_lock_upgrade_elision(), and eligible_for_lock_shared_elision(). The diff also adds assertions to validate these functions' correctness under single-threaded executions. Reviewed By: nbronson Differential Revision: D15545398 fbshipit-source-id: 0037d473c9dd360f7143ea4c4c9092fb9bb7f5f9
Showing
Please register or sign in to comment