MCPcopy Create free account
hub / github.com/Amanieu/asyncplusplus / get_threadpool_data_wrapper

Function get_threadpool_data_wrapper

src/threadpool_scheduler.cpp:134–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134static threadpool_data_wrapper get_threadpool_data_wrapper()
135{
136#if defined(EMULATE_PTHREAD_THREAD_LOCAL)
137 threadpool_data_wrapper* wrapper = static_cast<threadpool_data_wrapper*>(pthread_getspecific(get_local_threadpool_data_key()));
138 if(wrapper == nullptr) {
139 // if, for some reason, the wrapper is not set, this won't cause a crash
140 return threadpool_data_wrapper(nullptr, 0);
141 }
142 return *wrapper;
143#else
144 return threadpool_data_wrapper(owning_threadpool, thread_id);
145#endif
146}
147
148// Try to steal a task from another thread's queue
149static task_run_handle steal_task(threadpool_data* impl, std::size_t thread_id)

Callers 2

threadpool_wait_handlerFunction · 0.85
scheduleMethod · 0.85

Calls 2

Tested by

no test coverage detected