| 129 | |
| 130 | #if defined(_TTHREAD_POSIX_) |
| 131 | static 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 |