Add ability to wait the release of a lock, to acquire it or not