This is a simple lock mechanism useful for unit testing asynchronous blocks on iOS.