File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -462,11 +462,15 @@ int BLASFUNC(blas_thread_shutdown)(void){
462462
463463 for (i = 0 ; i < blas_num_threads - 1 ; i ++ ){
464464 // Could also just use WaitForMultipleObjects
465- WaitForSingleObject (blas_threads [i ], 5 ); //INFINITE);
465+ DWORD wait_thread_value = WaitForSingleObject (blas_threads [i ], 5000 );
466+
466467#ifndef OS_WINDOWSSTORE
467- // TerminateThread is only available with WINAPI_DESKTOP and WINAPI_SYSTEM not WINAPI_APP in UWP
468- TerminateThread (blas_threads [i ],0 );
468+ // TerminateThread is only available with WINAPI_DESKTOP and WINAPI_SYSTEM not WINAPI_APP in UWP
469+ if (WAIT_OBJECT_0 != wait_thread_value ) {
470+ TerminateThread (blas_threads [i ],0 );
471+ }
469472#endif
473+
470474 CloseHandle (blas_threads [i ]);
471475 }
472476
You can’t perform that action at this time.
0 commit comments