mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-17 13:01:41 +00:00
Changed: #872 threadid is now in size_t. patch by rti
This commit is contained in:
parent
ff6bbcc218
commit
33abc6286c
3 changed files with 4 additions and 4 deletions
|
@ -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…
Reference in a new issue