add some check for pthread api