Skip to content

Commit 13226e3

Browse files
author
Jehan
committed
driver: more reasonable thread wait timeout on Windows.
It used to be 5ms, which might not be long enough in some cases for the thread to exit well, but then when set to 5000 (5s), it would slow down any program depending on OpenBlas. Let's just set it to 50ms, which is at least 10 times longer than originally, but still reasonable in case of failed thread termination.
1 parent 1a6ea8e commit 13226e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver/others/blas_server_win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ int BLASFUNC(blas_thread_shutdown)(void){
462462

463463
for(i = 0; i < blas_num_threads - 1; i++){
464464
// Could also just use WaitForMultipleObjects
465-
DWORD wait_thread_value = WaitForSingleObject(blas_threads[i], 5000);
465+
DWORD wait_thread_value = WaitForSingleObject(blas_threads[i], 50);
466466

467467
#ifndef OS_WINDOWSSTORE
468468
// TerminateThread is only available with WINAPI_DESKTOP and WINAPI_SYSTEM not WINAPI_APP in UWP

0 commit comments

Comments
 (0)