Lines Matching refs:th

194                            kmp_info_t *th, int need_decrease_load) {  in __kmp_win32_cond_wait()  argument
283 static void __kmp_suspend_initialize_thread(kmp_info_t *th) { in __kmp_suspend_initialize_thread() argument
284 if (!TCR_4(th->th.th_suspend_init)) { in __kmp_suspend_initialize_thread()
287 __kmp_win32_cond_init(&th->th.th_suspend_cv); in __kmp_suspend_initialize_thread()
288 __kmp_win32_mutex_init(&th->th.th_suspend_mx); in __kmp_suspend_initialize_thread()
289 TCW_4(th->th.th_suspend_init, TRUE); in __kmp_suspend_initialize_thread()
293 void __kmp_suspend_uninitialize_thread(kmp_info_t *th) { in __kmp_suspend_uninitialize_thread() argument
294 if (TCR_4(th->th.th_suspend_init)) { in __kmp_suspend_uninitialize_thread()
297 __kmp_win32_cond_destroy(&th->th.th_suspend_cv); in __kmp_suspend_uninitialize_thread()
298 __kmp_win32_mutex_destroy(&th->th.th_suspend_mx); in __kmp_suspend_uninitialize_thread()
299 TCW_4(th->th.th_suspend_init, FALSE); in __kmp_suspend_uninitialize_thread()
307 kmp_info_t *th = __kmp_threads[th_gtid]; in __kmp_suspend_template() local
314 __kmp_suspend_initialize_thread(th); in __kmp_suspend_template()
315 __kmp_win32_mutex_lock(&th->th.th_suspend_mx); in __kmp_suspend_template()
342 TCW_PTR(th->th.th_sleep_loc, (void *)flag); in __kmp_suspend_template()
350 th->th.th_active = FALSE; in __kmp_suspend_template()
351 if (th->th.th_active_in_pool) { in __kmp_suspend_template()
352 th->th.th_active_in_pool = FALSE; in __kmp_suspend_template()
358 __kmp_win32_cond_wait(&th->th.th_suspend_cv, &th->th.th_suspend_mx, 0, in __kmp_suspend_template()
361 __kmp_win32_cond_wait(&th->th.th_suspend_cv, &th->th.th_suspend_mx, 0, in __kmp_suspend_template()
376 th->th.th_active = TRUE; in __kmp_suspend_template()
377 if (TCR_4(th->th.th_in_pool)) { in __kmp_suspend_template()
379 th->th.th_active_in_pool = TRUE; in __kmp_suspend_template()
384 __kmp_win32_mutex_unlock(&th->th.th_suspend_mx); in __kmp_suspend_template()
403 kmp_info_t *th = __kmp_threads[target_gtid]; in __kmp_resume_template() local
413 __kmp_suspend_initialize_thread(th); in __kmp_resume_template()
414 __kmp_win32_mutex_lock(&th->th.th_suspend_mx); in __kmp_resume_template()
417 flag = (C *)th->th.th_sleep_loc; in __kmp_resume_template()
428 __kmp_win32_mutex_unlock(&th->th.th_suspend_mx); in __kmp_resume_template()
436 __kmp_win32_mutex_unlock(&th->th.th_suspend_mx); in __kmp_resume_template()
440 TCW_PTR(th->th.th_sleep_loc, NULL); in __kmp_resume_template()
445 __kmp_win32_cond_signal(&th->th.th_suspend_cv); in __kmp_resume_template()
446 __kmp_win32_mutex_unlock(&th->th.th_suspend_mx); in __kmp_resume_template()
821 kmp_info_t *th = __kmp_threads[gtid]; in __kmp_terminate_thread() local
823 if (!th) in __kmp_terminate_thread()
828 if (TerminateThread(th->th.th_info.ds.ds_thread, (DWORD)-1) == FALSE) { in __kmp_terminate_thread()
831 __kmp_free_handle(th->th.th_info.ds.ds_thread); in __kmp_terminate_thread()
898 gtid = this_thr->th.th_info.ds.ds_gtid; in __kmp_launch_worker()
924 KMP_FSYNC_RELEASING(&this_thr->th.th_info.ds.ds_alive); in __kmp_launch_worker()
925 this_thr->th.th_info.ds.ds_thread_id = GetCurrentThreadId(); in __kmp_launch_worker()
926 TCW_4(this_thr->th.th_info.ds.ds_alive, TRUE); in __kmp_launch_worker()
930 TCW_PTR(this_thr->th.th_info.ds.ds_stackbase, &stack_data); in __kmp_launch_worker()
931 KMP_ASSERT(this_thr->th.th_info.ds.ds_stackgrow == FALSE); in __kmp_launch_worker()
936 KMP_FSYNC_RELEASING(&this_thr->th.th_info.ds.ds_alive); in __kmp_launch_worker()
937 TCW_4(this_thr->th.th_info.ds.ds_alive, FALSE); in __kmp_launch_worker()
955 this_thr->th.th_info.ds.ds_thread_id = GetCurrentThreadId(); in __kmp_launch_monitor()
956 TCW_4(this_thr->th.th_info.ds.ds_alive, TRUE); in __kmp_launch_monitor()
1037 TCW_4(this_thr->th.th_info.ds.ds_alive, FALSE); in __kmp_launch_monitor()
1044 void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) { in __kmp_create_worker() argument
1050 th->th.th_info.ds.ds_gtid = gtid; in __kmp_create_worker()
1061 GetCurrentProcess(), &th->th.th_info.ds.ds_thread, 0, in __kmp_create_worker()
1066 (LPVOID)th, th->th.th_info.ds.ds_thread)); in __kmp_create_worker()
1067 th->th.th_info.ds.ds_thread_id = GetCurrentThreadId(); in __kmp_create_worker()
1071 TCW_PTR(th->th.th_info.ds.ds_stackbase, &stack_data); in __kmp_create_worker()
1072 TCW_PTR(th->th.th_info.ds.ds_stacksize, 0); in __kmp_create_worker()
1073 TCW_4(th->th.th_info.ds.ds_stackgrow, TRUE); in __kmp_create_worker()
1074 __kmp_check_stack_overlap(th); in __kmp_create_worker()
1086 TCW_PTR(th->th.th_info.ds.ds_stacksize, stack_size); in __kmp_create_worker()
1087 TCW_4(th->th.th_info.ds.ds_stackgrow, FALSE); in __kmp_create_worker()
1093 (LPVOID)th, &idThread)); in __kmp_create_worker()
1097 (LPVOID)th, STACK_SIZE_PARAM_IS_A_RESERVATION, &idThread); in __kmp_create_worker()
1104 (LPVOID)th, idThread, handle)); in __kmp_create_worker()
1110 th->th.th_info.ds.ds_thread = handle; in __kmp_create_worker()
1119 int __kmp_still_running(kmp_info_t *th) { in __kmp_still_running() argument
1120 return (WAIT_TIMEOUT == WaitForSingleObject(th->th.th_info.ds.ds_thread, 0)); in __kmp_still_running()
1124 void __kmp_create_monitor(kmp_info_t *th) { in __kmp_create_monitor() argument
1133 th->th.th_info.ds.ds_tid = 0; // this makes reap_monitor no-op in __kmp_create_monitor()
1134 th->th.th_info.ds.ds_gtid = 0; in __kmp_create_monitor()
1151 th->th.th_info.ds.ds_tid = KMP_GTID_MONITOR; in __kmp_create_monitor()
1152 th->th.th_info.ds.ds_gtid = KMP_GTID_MONITOR; in __kmp_create_monitor()
1170 (LPTHREAD_START_ROUTINE)__kmp_launch_monitor, (LPVOID)th, in __kmp_create_monitor()
1176 th->th.th_info.ds.ds_thread = handle; in __kmp_create_monitor()
1181 (void *)th->th.th_info.ds.ds_thread)); in __kmp_create_monitor()
1191 int __kmp_is_thread_alive(kmp_info_t *th, DWORD *exit_val) { in __kmp_is_thread_alive() argument
1193 rc = GetExitCodeThread(th->th.th_info.ds.ds_thread, exit_val); in __kmp_is_thread_alive()
1207 static void __kmp_reap_common(kmp_info_t *th) { in __kmp_reap_common() argument
1213 10, ("__kmp_reap_common: try to reap (%d)\n", th->th.th_info.ds.ds_gtid)); in __kmp_reap_common()
1230 KMP_FSYNC_SPIN_INIT(obj, (void *)&th->th.th_info.ds.ds_alive); in __kmp_reap_common()
1237 __kmp_is_thread_alive(th, &exit_val); in __kmp_reap_common()
1240 } while (exit_val == STILL_ACTIVE && TCR_4(th->th.th_info.ds.ds_alive)); in __kmp_reap_common()
1250 __kmp_free_handle(th->th.th_info.ds.ds_thread); in __kmp_reap_common()
1257 } else if ((void *)exit_val != (void *)th) { in __kmp_reap_common()
1264 th->th.th_info.ds.ds_gtid, th->th.th_info.ds.ds_thread)); in __kmp_reap_common()
1266 th->th.th_info.ds.ds_thread = 0; in __kmp_reap_common()
1267 th->th.th_info.ds.ds_tid = KMP_GTID_DNE; in __kmp_reap_common()
1268 th->th.th_info.ds.ds_gtid = KMP_GTID_DNE; in __kmp_reap_common()
1269 th->th.th_info.ds.ds_thread_id = 0; in __kmp_reap_common()
1275 void __kmp_reap_monitor(kmp_info_t *th) { in __kmp_reap_monitor() argument
1279 (void *)th->th.th_info.ds.ds_thread)); in __kmp_reap_monitor()
1284 KMP_DEBUG_ASSERT(th->th.th_info.ds.ds_tid == th->th.th_info.ds.ds_gtid); in __kmp_reap_monitor()
1285 if (th->th.th_info.ds.ds_gtid != KMP_GTID_MONITOR) { in __kmp_reap_monitor()
1298 th->th.th_info.ds.ds_gtid)); in __kmp_reap_monitor()
1299 __kmp_reap_common(th); in __kmp_reap_monitor()
1307 void __kmp_reap_worker(kmp_info_t *th) { in __kmp_reap_worker() argument
1309 th->th.th_info.ds.ds_gtid)); in __kmp_reap_worker()
1310 __kmp_reap_common(th); in __kmp_reap_worker()