add read_write lock apis using pthread locks and pthread conds