Removing that line would get rid of the error, but I still would like to use semaphores.