add getopt, ThreadClass