Replace rwlock by mutex