make rw_lock work well at linux