use mutex instead of rwmutex