An Adaptive Approach to Recoverable Mutual Exclusion