Fix incorrect initial value of __kmp_affinity_type.

Affinity initialization code expects __kmp_affinity_type has the value
affinity_default by default, but the cleanup code does not properly set the
value back to affinity_default.  This may introduce some issues when multiple
roots are trying to initialize/uninitialize the runtime successively.

Patch by Hansang Bae

Differential Revision: https://reviews.llvm.org/D31012

llvm-svn: 298313
This commit is contained in:
Jonathan Peyton 2017-03-20 22:04:02 +00:00
parent 6b00d40900
commit 16fd8fec76

View File

@ -4197,6 +4197,7 @@ __kmp_affinity_uninitialize(void)
__kmp_affin_fullMask = NULL;
}
__kmp_affinity_num_masks = 0;
__kmp_affinity_type = affinity_default;
# if OMP_40_ENABLED
__kmp_affinity_num_places = 0;
# endif