I doubt if there were issues with the mutexes in Redhat 8. Maybe other areas, but I bet the mutexes were fairly solid. Anyway, I can see why you would end up with MAX_THREADS+1. Look at the code. You are doing your conditional check on the num_threads outside of the mutex. Do you see why that is a problem? Imagine that you are sitting at num_threads = MAX_THREADS-1 currently. Then thread1 comes along. It says, num_threads less than max, I can continue. Then context switch happens, and control goes to thread2. It looks at num_threads, says num_threads is less than max, I can continue. So then each thread obtains the mutex and increments num_threads. Now you have num_threads == MAX_THREADS+1. So change the logic to something like: