In addition to the previous commit, this commit makes threads need to wait for the thread manager to say it took the mutex from them before they can ask for it again.
skip waiting for the manager to give them the mutex The solution was to remove write access from threads to the manager_took_mutex variable