rwlock implemented by pthread_mutex_t