fixed deadlock problem on linux