[PATCH] D32782: Add pthread_self function prototype and make it speculatable.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 20 13:17:15 PDT 2017


davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D32782#760260, @trentxintong wrote:

> BTW, GCC moves pthread_self out of the loop on Linux. so I would think this is legal on linux. Unless GCC handles pthread_self differently on different platforms, I think this would be fine.
>
> Also, if you read this carefully http://h20564.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c02267692&lang=en-us&cc=us
>
> Its saying the "thread ID  returned is the same ID that is returned in the thread parameter to the creating thread at thread creation time", basically implying the thread ID returned by pthread_self stays the same


That's just the HP-UX documentation, not the standard.
http://pubs.opengroup.org/onlinepubs/9699919799/

Anyway, after all this elucubration, LGTM.


https://reviews.llvm.org/D32782





More information about the llvm-commits mailing list