a implementation of template class that is used for create event-driven task thread.