this version remove some bugs and only use one mutex to realize the message queue