Add functions that check if a lock is held.