[OpenMP] Fix a segment fault in __kmp_get_global_thread_id
In `__kmp_get_global_thread_id`, if the gtid mode is 1, after getting the gtid from TLS, it will store the gtid value to the thread stack maintained in the thread descriptor. However, `__kmp_get_global_thread_id` can be called when the library is destructed, after the corresponding thread info has been release. This will cause a segment fault. This can happen on an Intel-based Mac. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D159324
Loading
Please sign in to comment