Cache current thread ID in TLS (#24699)
authorLeandro A. F. Pereira <leandro.pereira@microsoft.com>
Wed, 22 May 2019 15:17:26 +0000 (08:17 -0700)
committerJan Vorlicek <janvorli@microsoft.com>
Wed, 22 May 2019 15:17:26 +0000 (08:17 -0700)
commit41239feb757e7a5b5f0b710b810010df016d4391
tree4b91dd12cd0075baa2c496359b68ab46d51c6465
parentaa66f12b58dc11857db5796ff49bd46dd242dd82
Cache current thread ID in TLS (#24699)

While looking at the strace of `corerun` built with logging and
debugging information, I was amazed at the number of gettid() calls it
was making.  While system calls are cheap, they're still not free;
cache this number in the thread local storage area.  Adds a branch, but
it's just a comparison with 0, so it's fine in comparison.
src/pal/src/include/pal/thread.hpp