add thread.h and thread.cpp