With lock timeout

That would cause that the code of the `withLock` won't change much.