add critical variables and mutexes for testing