using a RWMutex instead of a simple Mutex