| 106 | |
| 107 | |
| 108 | CStatus UThreadPool::destroy() { |
| 109 | CGRAPH_FUNCTION_BEGIN |
| 110 | if (!is_init_) { |
| 111 | CGRAPH_FUNCTION_END |
| 112 | } |
| 113 | |
| 114 | // primary 线程是普通指针,需要delete |
| 115 | for (auto &pt : primary_threads_) { |
| 116 | status += pt->destroy(); |
| 117 | CGRAPH_DELETE_PTR(pt) |
| 118 | } |
| 119 | CGRAPH_FUNCTION_CHECK_STATUS |
| 120 | primary_threads_.clear(); |
| 121 | |
| 122 | // secondary 线程是智能指针,不需要delete |
| 123 | for (auto &st : secondary_threads_) { |
| 124 | status += st->destroy(); |
| 125 | } |
| 126 | CGRAPH_FUNCTION_CHECK_STATUS |
| 127 | secondary_threads_.clear(); |
| 128 | is_init_ = false; |
| 129 | |
| 130 | CGRAPH_FUNCTION_END |
| 131 | } |
| 132 | |
| 133 | |
| 134 | CIndex UThreadPool::dispatch(CIndex origIndex) { |
nothing calls this directly
no outgoing calls
no test coverage detected