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

hg/feature/sound
vl 15 years ago
parent b1775e4b40
commit fa7b90e27d

@ -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 );

@ -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

@ -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;

Loading…
Cancel
Save