Add GetCurrentThreadID finction.

This commit is contained in:
vng 2011-07-28 23:20:24 +03:00 committed by Alex Zolotarev
parent 018078a94f
commit 3fb7845441
2 changed files with 11 additions and 0 deletions

View file

@ -176,6 +176,15 @@ namespace threads
t.tv_nsec =(ms * 1000000) % 1000000000;
t.tv_sec = (ms * 1000000) / 1000000000;
nanosleep(&t, 0);
#endif
}
int GetCurrentThreadID()
{
#ifdef OMIM_OS_WINDOWS
return ::GetCurrentThreadId();
#else
return pthread_self();
#endif
}
}

View file

@ -47,4 +47,6 @@ namespace threads
/// @param[in] ms time-out interval in milliseconds
void Sleep(size_t ms);
int GetCurrentThreadID();
} // namespace threads