Update thread.cpp