MCPcopy Create free account
hub / github.com/apache/trafficserver / TSThreadDestroy

Function TSThreadDestroy

src/api/InkIOCoreAPI.cc:195–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195void
196TSThreadDestroy(TSThread thread)
197{
198 sdk_assert(sdk_sanity_check_iocore_structure(thread) == TS_SUCCESS);
199
200 INKThreadInternal *ithread = reinterpret_cast<INKThreadInternal *>(thread);
201
202 // The thread must be destroyed by the same thread that created
203 // it because that thread is holding the thread mutex.
204 ink_release_assert(ithread->mutex->thread_holding == ithread);
205
206 // If this thread was created by TSThreadCreate() rather than
207 // TSThreadInit, then we must not destroy it before it's done.
208 if (ithread->func) {
209 ink_release_assert(ithread->completion.done == true);
210 }
211
212 delete ithread;
213}
214
215TSThread
216TSThreadSelf(void)

Callers 3

pthread_start_funcFunction · 0.85
~ThreadPoolMethod · 0.85

Calls 1

Tested by 2

pthread_start_funcFunction · 0.68