Replaced rwlock with mutex.