Add mutex, or wait don't work correctly
Merge pull request #48 from Xele02/master

Mutex cond_wait not working