Semaphores in  C ++