add overridable locking functions