Implemented mutex. There is a bug related to the mutex's queue.