Looking at the code, it looks like we do not need a recursive mutex. Can we switch to a simple mutex?