Properly init the semaphore in the readers/writers code.