MCPcopy Create free account
hub / github.com/ChunelFeng/CThreadPool / destroy

Method destroy

src/UtilsCtrl/ThreadPool/UThreadPool.cpp:108–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107
108CStatus 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
134CIndex UThreadPool::dispatch(CIndex origIndex) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected