Changed: #872 threadid is now in size_t. patch by rti

This commit is contained in:
vl 2010-05-13 19:00:29 +02:00
parent ff6bbcc218
commit 33abc6286c
3 changed files with 4 additions and 4 deletions

View file

@ -298,7 +298,7 @@ void nlSleep( uint32 ms );
#endif #endif
/// Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id) /// Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id)
uint getThreadId(); size_t getThreadId();
/// Returns a readable string from a vector of bytes. unprintable char are replaced by '?' /// Returns a readable string from a vector of bytes. unprintable char are replaced by '?'
std::string stringFromVector( const std::vector<uint8>& v, bool limited = true ); std::string stringFromVector( const std::vector<uint8>& v, bool limited = true );

View file

@ -107,12 +107,12 @@ void nlSleep( uint32 ms )
/* /*
* Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id) * Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id)
*/ */
uint getThreadId() size_t getThreadId()
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
return GetCurrentThreadId(); return GetCurrentThreadId();
#elif defined NL_OS_UNIX #elif defined NL_OS_UNIX
return uint(pthread_self()); return size_t(pthread_self());
// doesnt work on linux kernel 2.6 return getpid(); // doesnt work on linux kernel 2.6 return getpid();
#endif #endif

View file

@ -34,7 +34,7 @@ using namespace NLMISC;
namespace NLNET { namespace NLNET {
static uint ThreadCreator = 0; static size_t ThreadCreator = 0;
static const uint64 AppIdDeadConnection = 0xDEAD; static const uint64 AppIdDeadConnection = 0xDEAD;