Skip to content

Commit 32e9693

Browse files
Kenostaticfloat
authored andcommitted
[OpenBLAS] Add hang-on-exit patch (#353)
This is the patch from JuliaLang/julia#34225, but against 0.3.7 not 0.3.5.
1 parent 98da22f commit 32e9693

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

O/OpenBLAS/build_tarballs.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ fi
7171
7272
7373
# Enter the fun zone
74-
cd ${WORKSPACE}/srcdir/OpenBLAS-*/
74+
cd ${WORKSPACE}/srcdir/OpenBLAS*/
75+
76+
atomic_patch -p1 ${WORKSPACE}/srcdir/patches/openblas-winexit.patch
7577
7678
# Build the actual library
7779
make "${flags[@]}"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
commit b16fa2e7111dc4dc1d9d987bd5dcbf89c82b9ee8
2+
Author: Keno Fischer <keno@juliacomputing.com>
3+
Date: Sun Dec 29 15:08:13 2019 -0500
4+
5+
win32: Don't run cleanup if we're about to exit anyway
6+
7+
If the process is about to exit, there's no point trying to do
8+
a bunch of work to clean up resources. The kernel will release
9+
them much more efficiently when the process exits at the end
10+
of this function.
11+
12+
diff --git a/exports/dllinit.c b/exports/dllinit.c
13+
index 4a05c0e1..88f9af65 100644
14+
--- a/exports/dllinit.c
15+
+++ b/exports/dllinit.c
16+
@@ -50,7 +50,10 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
17+
gotoblas_init();
18+
break;
19+
case DLL_PROCESS_DETACH:
20+
- gotoblas_quit();
21+
+ // If the process is about to exit, don't bother releasing any resources
22+
+ // The kernel is much better at bulk releasing then.
23+
+ if (!reserved)
24+
+ gotoblas_quit();
25+
break;
26+
case DLL_THREAD_ATTACH:
27+
break;

0 commit comments

Comments
 (0)