[PATCH] D30526: [Support] Add functions to get and set thread name.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 07:14:22 PST 2017


I can remove the np. I thought it might be useful since osx threads are not
globally unique, but i think it's fine to remove it.

I think I've addressed pretty much everything, so I'll try to submit this
later today if there's no further comments
On Fri, Mar 3, 2017 at 4:34 AM Pavel Labath via Phabricator <
reviews at reviews.llvm.org> wrote:

> labath added a comment.
>
> Thank you, it looks much better. Let me know what you think about the name.
>
>
>
> ================
> Comment at: llvm/include/llvm/Support/Threading.h:133
> +
> +  uint64_t get_threadid_np();
> +
> ----------------
> I'd remove the `_np` suffix. It is present on the pthread functions to
> differentiate them from other `pthread_***` functions, which are expected
> to behave the same on all conforming implementations. Since the purpose of
> this function is to provide a *portable* wrapper around different versions
> of those functions, having the suffix here seems wrong.
>
>
> ================
> Comment at: llvm/lib/Support/Unix/Threading.inc:100
> +#else
> +  return uint64_t(pthread_self());
> +#endif
> ----------------
> I am wondering whether this is a useful fallback. pthread_t is used in
> completely different contexts than OS-level thread handles, so it may be
> better to just return 0 or something here. I don't feel strongly about it
> though.
>
>
> https://reviews.llvm.org/D30526
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170303/e5940742/attachment.html>


More information about the llvm-commits mailing list