Fixed encoder threads added semaphores