Improve lock semantics