| 40 | } |
| 41 | |
| 42 | void WorkerThread::run() { |
| 43 | co_init_curr_thread_env(); |
| 44 | co_enable_hook_sys(); |
| 45 | monitor_routine_->start(); |
| 46 | for (size_t i = 0; i < io_routines_.size(); ++i) { |
| 47 | io_routines_[i]->start(); |
| 48 | } |
| 49 | connection_dispatcher_->start(); |
| 50 | co_eventloop(co_get_epoll_ct(), TickFunc, 0); |
| 51 | } |
| 52 | |
| 53 | int WorkerThread::AssignFD(int fd) { |
| 54 | return connection_dispatcher_->AssignFD(fd); |