Fix detection of the proper pthread_setname_np and pthread_set_name_np

variants on FreeBSD, OpenBSD and Darwin.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38266 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2014-12-28 13:19:19 +00:00
parent 8bd3e228d1
commit 0fe75d0805
4 changed files with 3303 additions and 18873 deletions

View file

@ -135,13 +135,13 @@ static int SetThreadName(DWORD dwThreadID, const char *threadName)
}
}
#define PTHREAD_SETNAME(a,b) SetThreadName(-1, b)
#define PTHREAD_SETNAME(a) SetThreadName(-1, a)
#endif
#endif
#ifndef PTHREAD_SETNAME
#define PTHREAD_SETNAME(a,b) -1
#define PTHREAD_SETNAME(a) -1
#endif
@ -807,13 +807,13 @@ unregisterActiveThread(NSThread *thread)
while (result != 0 && [aName length] > 0)
{
result = PTHREAD_SETNAME(pthread_self(),
[aName cStringUsingEncoding: NSUTF8StringEncoding]);
result =
PTHREAD_SETNAME([aName cStringUsingEncoding: NSUTF8StringEncoding]);
if (result != 0)
{
if (ERANGE == errno)
{
/* Name must be too long ... gnu/linix uses 15 characters
/* Name must be too long ... gnu/linux uses 15 characters
*/
if ([aName length] > 15)
{