initial working thread and thread start code generation.
generate the thread run method.