added a new method acquireAndWait to make easy to use the lib