add pthread barrier support