Thread diagnositc changes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38768 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-07-08 12:54:15 +00:00
parent dffcd0bb1c
commit 999fda788a
7 changed files with 110 additions and 28 deletions

View file

@ -111,17 +111,17 @@
* it makes no sense externally, it can still be used to show that
* different threads generated different logs.
*/
unsigned long
NSUInteger
GSPrivateThreadID()
{
#if defined(__MINGW__)
return (unsigned long)GetCurrentThreadId();
return (NSUInteger)GetCurrentThreadId();
#elif defined(HAVE_GETTID)
return (unsigned long)syscall(SYS_gettid);
return (NSUInteger)syscall(SYS_gettid);
#elif defined(HAVE_PTHREAD_GETTHREADID_NP)
return pthread_getthreadid_np();
#else
return (unsigned long)GSCurrentThread();
return (NSUInteger)GSCurrentThread();
#endif
}
@ -796,8 +796,8 @@ unregisterActiveThread(NSThread *thread)
- (NSString*) description
{
return [NSString stringWithFormat: @"%@{name = %@, num = %lu}",
[super description], _name, GSPrivateThreadID()];
return [NSString stringWithFormat: @"%@{name = %@, num = %llu}",
[super description], _name, (unsigned long long)GSPrivateThreadID()];
}
- (id) init