std mutex replaced for pthread_rwlock_t