Removed use of semaphores for mutex, since there should only be one thread in control of the resource.
Merge branch 'refactor_to_mutex' into integration