Fixing thread
Finishing mutex and conditions