multithreading waiting fixes
Merge pull request #72 from Ashatta/master

multithreading waiting fixes