| 97 | static pthread_once_t g_keyOnce = PTHREAD_ONCE_INIT; |
| 98 | |
| 99 | bool 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. |
| 107 | static std::vector<DestructorInfo> *g_ListMainThread = nullptr; |
no outgoing calls
no test coverage detected