mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
8bd3e228d1
commit
0fe75d0805
4 changed files with 3303 additions and 18873 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue