build: removing OpenBlas patches.

Our installer use Msys2 packages when possible. And Msys2 repository
provides version 0.3.9, released on March 2, which contains our patches.
No need for them here anymore, no need to make custom builds.
This commit is contained in:
Jehan 2020-04-20 23:50:43 +02:00
parent 5dc1572b01
commit 0aca033370
2 changed files with 0 additions and 87 deletions

View File

@ -1,56 +0,0 @@
From 1f6071590d5b4fa3b52aa1456a9648ae354b2c7a Mon Sep 17 00:00:00 2001
From: Jehan <jehan@girinstud.io>
Date: Wed, 20 Nov 2019 12:21:35 +0100
Subject: [PATCH] Fix usage of TerminateThread() causing critical section
corruption.
This patch was submitted to the GIMP project by a publisher wishing to
keep confidentiality (hence anonymously). I just pass along the patch.
Here is the patch explanation which came with:
First they remind us what Microsoft documentation says about
TerminateThread:
> TerminateThread is a dangerous function that should only be used in
> the most extreme cases. You should call TerminateThread only if you
> know exactly what the target thread is doing, and you control all of
> the code that the target thread could possibly be running at the time
> of the termination.
(https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread)
Then they say that 5 milliseconds time-out might not be long enough for
the thread to exit gracefully. They propose to set it to a much higher
value (for instance here 5 seconds).
And finally you should always check the return value of
WaitForSingleObject(). In particular you want to run TerminateThread()
only if WaitForSingleObject() failed, not on success case.
---
driver/others/blas_server_win32.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/driver/others/blas_server_win32.c b/driver/others/blas_server_win32.c
index bace54a2..e27725ba 100644
--- a/driver/others/blas_server_win32.c
+++ b/driver/others/blas_server_win32.c
@@ -462,11 +462,15 @@ int BLASFUNC(blas_thread_shutdown)(void){
for(i = 0; i < blas_num_threads - 1; i++){
// Could also just use WaitForMultipleObjects
- WaitForSingleObject(blas_threads[i], 5); //INFINITE);
+ DWORD wait_thread_value = WaitForSingleObject(blas_threads[i], 5000);
+
#ifndef OS_WINDOWSSTORE
-// TerminateThread is only available with WINAPI_DESKTOP and WINAPI_SYSTEM not WINAPI_APP in UWP
- TerminateThread(blas_threads[i],0);
+ // TerminateThread is only available with WINAPI_DESKTOP and WINAPI_SYSTEM not WINAPI_APP in UWP
+ if (WAIT_OBJECT_0 != wait_thread_value) {
+ TerminateThread(blas_threads[i],0);
+ }
#endif
+
CloseHandle(blas_threads[i]);
}
--
2.23.0

View File

@ -1,31 +0,0 @@
From 13226e310195c7dd5e051c791c4f0839f2f606c4 Mon Sep 17 00:00:00 2001
From: Jehan <jehan@girinstud.io>
Date: Wed, 11 Dec 2019 17:51:42 +0100
Subject: [PATCH] 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.
---
driver/others/blas_server_win32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/driver/others/blas_server_win32.c b/driver/others/blas_server_win32.c
index e27725ba..5ecc4428 100644
--- a/driver/others/blas_server_win32.c
+++ b/driver/others/blas_server_win32.c
@@ -462,7 +462,7 @@ int BLASFUNC(blas_thread_shutdown)(void){
for(i = 0; i < blas_num_threads - 1; i++){
// Could also just use WaitForMultipleObjects
- DWORD wait_thread_value = WaitForSingleObject(blas_threads[i], 5000);
+ DWORD wait_thread_value = WaitForSingleObject(blas_threads[i], 50);
#ifndef OS_WINDOWSSTORE
// TerminateThread is only available with WINAPI_DESKTOP and WINAPI_SYSTEM not WINAPI_APP in UWP
--
2.23.0