add check for lr != null to threadHoldsLock