Disable threadprivate data cleanup if runtime is terminating
authorJonathan Peyton <jonathan.l.peyton@intel.com>
Tue, 24 Oct 2017 16:10:09 +0000 (16:10 +0000)
committerJonathan Peyton <jonathan.l.peyton@intel.com>
Tue, 24 Oct 2017 16:10:09 +0000 (16:10 +0000)
commitdff0ee2f4ecfa953bb575ea6bd5df0280ca84d4b
treed4b4102f5963c7a4d79c756456453295ba304674
parente3f6eb1a74cb23dd7872a613cb79fd7e40b2270b
Disable threadprivate data cleanup if runtime is terminating

The problem is due to the runtime's threadprivate cleanup code which tries to
access data that was already destroyed by one of the root threads.
__kmp_init_gtid is used as a checker here since it is set to false before actual
resource cleanup is done in __kmp_cleanup().

Patch by Hansang Bae

llvm-svn: 316452
openmp/runtime/src/kmp_threadprivate.cpp