lock abstraction