Removed unnecessary locke and semaphores.