add CoMTaskGenerator, add setState in threadInit