Before, both mutexes and semaphores were used. Using only the latter and with a bit of cleanup to remove some code bloat, we save ~600 bytes of code.