folly::SharedMutexImpl::eligible_for_lock_elision

Checks whether an exclusive lock could succeed so that lock elision can be enabled.

Synopsis

Declared in <folly/SharedMutex.h>

bool
eligible_for_lock_elision() const;

Description

Different from the two eligible_for_lock_{upgrade,shared}_elision functions, this is a conservative check since kMayDefer indicates "may-existing" deferred readers.

Return Value

true if exclusive locking looks eligible for elision.