mutexes create fix.
Merge pull request #34 from nem0/multithread_refactor

mutexes create fix.