Fix bugs about mutex
Merge pull request #4 from tamanyan/master

Fix bugs about mutex