Semaphore implementation for (PTH) pthreads
