Added a demo. implementation of a semaphore