MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / _pthread_t_to_ID

Function _pthread_t_to_ID

src/tinythread/tinythread.cpp:131–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130#if defined(_TTHREAD_POSIX_)
131static thread::id _pthread_t_to_ID(const pthread_t &aHandle)
132{
133 static mutex idMapLock;
134 static std::map<pthread_t, unsigned long int> idMap;
135 static unsigned long int idCount(1);
136
137 lock_guard<mutex> guard(idMapLock);
138 if(idMap.find(aHandle) == idMap.end())
139 idMap[aHandle] = idCount ++;
140 return thread::id(idMap[aHandle]);
141}
142#endif // _TTHREAD_POSIX_
143
144

Callers 1

get_idMethod · 0.85

Calls 2

idClass · 0.85
endMethod · 0.80

Tested by

no test coverage detected