I have two functions that I use semaphore and mutex for a variant of classic the sleeping barber problem. But when I run the program, the program never ends.
Function