added a new method acquireAndWait to make easy to use the lib and a example that use it