MCPcopy Create free account
hub / github.com/RichieSams/FiberTaskingLib / GetCurrentThreadIndex

Method GetCurrentThreadIndex

source/task_scheduler.cpp:470–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468#if defined(FTL_WIN32_THREADS)
469
470FTL_NOINLINE unsigned TaskScheduler::GetCurrentThreadIndex() const {
471 DWORD const threadId = ::GetCurrentThreadId();
472 for (unsigned i = 0; i < m_numThreads; ++i) {
473 if (m_threads[i].Id == threadId) {
474 return i;
475 }
476 }
477
478 return kInvalidIndex;
479}
480
481#elif defined(FTL_POSIX_THREADS)
482

Callers 4

FiberStartFuncMethod · 0.80
ThreadEndFuncMethod · 0.80
ThreadLocalClass · 0.80
operator->Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected