Created attachment 604687 [details] [diff] [review]
Useful for gdb, this code is an adaption from chromium/src/base/threading/platform_thread_posix.cc.
Created attachment 604688 [details]
Screenshot (IPC thread 5+21 fixed by this patch)
Is this related to bug 720778 at all?
Comment on attachment 604687 [details] [diff] [review]
Did you check if this was fixed in upstream chromium? I'd be happy to pull a change from there, too.
>+ std::string shortened_name = std::string(name).substr(0, kMaxNameLength);
>+ // pthread_setname() fails (harmlessly) in the sandbox, ignore when it does.
>+ // See http://crbug.com/47058
What's the ownership model for the pointer here? Please doc.
r=me with ownership clarified (/ proven correct ;) ).
I got the code from 'chromium/src/base/threading/platform_thread_posix.cc', wouldn't that be upstream? The change doesn't apply cleanly so I had to make a patch manually.
I looked in bionic and it's implemented by copying name:
So it must certainly be the same elsewhere. I'll add a comment when checking in.
Pulling from upstream is good. Would prefer you check the darwin docs, but r+ from upstream (hopefully) means someone else already checked docs.