MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / IsMainThread

Function IsMainThread

src/nvcv/util/Compat.cpp:99–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97static pthread_once_t g_keyOnce = PTHREAD_ONCE_INIT;
98
99bool IsMainThread()
100{
101 // Works on Linux.
102 // Ref: https://stackoverflow.com/questions/4867839/how-can-i-tell-if-pthread-self-is-the-main-first-thread-in-the-process
103 return syscall(SYS_gettid) == getpid();
104}
105
106// Destructor list to be used for objects in main thread.
107static std::vector<DestructorInfo> *g_ListMainThread = nullptr;

Callers 1

my_thread_atexit_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected