diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2012-12-20 01:00:16 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2012-12-20 01:00:16 +0000 |
commit | 2c2586d12e7757a41a1eda0c47c6b9c2fabe970e (patch) | |
tree | 42b647581603cbc8166a0e56555d79831f50e7ad | |
parent | 5b9f36f126ba3079ff5ffece2562b78755391054 (diff) |
[Author: aharper]
Fix pthread_setname_np() call for empty strings (some OS versions don't
handle NULL).
R=dmaclach,thomasvl
APPROVED=dmaclach
DELTA=7 (6 added, 0 deleted, 1 changed)
-rw-r--r-- | Foundation/GTMNSThread+Blocks.m | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Foundation/GTMNSThread+Blocks.m b/Foundation/GTMNSThread+Blocks.m index c5458be..d8660cc 100644 --- a/Foundation/GTMNSThread+Blocks.m +++ b/Foundation/GTMNSThread+Blocks.m @@ -93,7 +93,13 @@ enum { } - (void)setThreadDebuggerName:(NSString *)name { - if (gPThreadSetNameNP) gPThreadSetNameNP([name UTF8String]); + if (gPThreadSetNameNP) { + if ([name length]) { + gPThreadSetNameNP([name UTF8String]); + } else { + gPThreadSetNameNP(""); + } + } } - (void)main { |