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

Class threadpool_data_wrapper

src/threadpool_scheduler.cpp:83–89  ·  view source on GitHub ↗

this wrapper encapsulates both the owning_threadpool pointer and the thread id. this is done to improve performance on the emulated thread_local reducing the number of calls to "pthread_getspecific"

Source from the content-addressed store, hash-verified

81// this is done to improve performance on the emulated thread_local reducing the number
82// of calls to "pthread_getspecific"
83struct threadpool_data_wrapper {
84 threadpool_data* owning_threadpool;
85 std::size_t thread_id;
86
87 threadpool_data_wrapper(threadpool_data* owning_threadpool, std::size_t thread_id):
88 owning_threadpool(owning_threadpool), thread_id(thread_id) { }
89};
90
91#if defined(EMULATE_PTHREAD_THREAD_LOCAL)
92struct pthread_emulation_threadpool_data_initializer {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected