use size_t to better represent thread id across platforms

This commit is contained in:
gabime
2015-04-07 21:35:41 +03:00
parent 7105fdadf9
commit 0684b4f378
4 changed files with 9 additions and 8 deletions

View File

@@ -32,11 +32,11 @@
# define WIN32_LEAN_AND_MEAN
# endif
# include <Windows.h>
#elif __linux__
#elif __linux__
#include <sys/syscall.h> //Use gettid() syscall under linux to get thread id
#include <unistd.h>
#else
#include <pthread.h>
#include <pthread.h>
#endif
#include "../common.h"
@@ -172,14 +172,14 @@ inline int utc_minutes_offset(const std::tm& tm = details::os::localtime())
}
//Return current thread id as 64 bit integer
inline uint64_t thread_id()
inline size_t thread_id()
{
#ifdef _WIN32
return ::GetCurrentThreadId();
#elif __linux__
return (uint64_t) syscall(SYS_gettid);
#else
#else
return (uint64_t) pthread_self();
#endif