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

Function TSThreadCreate

src/api/InkIOCoreAPI.cc:134–154  ·  view source on GitHub ↗

* INKqa12653. Return TSThread or null if error */

Source from the content-addressed store, hash-verified

132 * INKqa12653. Return TSThread or null if error
133 */
134TSThread
135TSThreadCreate(TSThreadFunc func, void *data)
136{
137 INKThreadInternal *thread;
138 ink_thread tid = 0;
139
140 thread = new INKThreadInternal;
141
142 ink_assert(thread->event_types == 0);
143 ink_assert(thread->mutex->thread_holding == thread);
144
145 thread->func = func;
146 thread->data = data;
147
148 ink_thread_create(&tid, ink_thread_trampoline, (void *)thread, 1, 0, nullptr);
149 if (!tid) {
150 return (TSThread) nullptr;
151 }
152
153 return reinterpret_cast<TSThread>(thread);
154}
155
156// Wait for a thread to complete. When a thread calls TSThreadCreate,
157// it becomes the owner of the thread's mutex. Since only the thread

Callers 7

thread_pluginFunction · 0.85
TSPluginInitFunction · 0.85
Blocking_actionClass · 0.85
TSPluginInitFunction · 0.85
TSPluginInitFunction · 0.85
ThreadPoolMethod · 0.85

Calls 1

ink_thread_createFunction · 0.85

Tested by 1