Improve stability of the runtime in parent/child processes
This change improves stability of the runtime when the application forks child processes. Acquiring/releasing __kmp_initz_lock and __kmp_forkjoin_lock in the atfork handlers insures that the actual fork does not occur while those two locks are held, and __kmp_itt_reset() reverts the itt's global state to the initial state which also initializes the mutex stored in the global state. Some missing initialization code was also inserted in the child's atfork handler. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D41462 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@322202 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -94,7 +94,7 @@ static int __kmp_unregister_root_other_thread(int gtid);
|
||||
#endif
|
||||
static void __kmp_unregister_library(void); // called by __kmp_internal_end()
|
||||
static void __kmp_reap_thread(kmp_info_t *thread, int is_root);
|
||||
static kmp_info_t *__kmp_thread_pool_insert_pt = NULL;
|
||||
kmp_info_t *__kmp_thread_pool_insert_pt = NULL;
|
||||
|
||||
/* Calculate the identifier of the current thread */
|
||||
/* fast (and somewhat portable) way to get unique identifier of executing
|
||||
|
||||
Reference in New Issue
Block a user