Otherwise, an xlock waiter can become starved as a LocalLock supports multiple
writers.
Strictly speaking, a new lock state would be appropriate for this but we cheat
frequently with the LocalLock -- there is only one state. All transition checks
are already manually performed by the Locker.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit
bddd3c72014dc7aa4bb4f16e4633111a0f2e0bb0)
}
bool can_wrlock() const {
- return !is_xlocked();
+ return !is_xlocked() && !is_waiter_for(SimpleLock::WAIT_XLOCK);
}
void get_wrlock(client_t client) {
ceph_assert(can_wrlock());