add a new thread constructor for pthread