-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenBLAS] Add hang-on-exit patch (#353)
This is the patch from JuliaLang/julia#34225, but against 0.3.7 not 0.3.5.
- Loading branch information
1 parent
98da22f
commit 32e9693
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
commit b16fa2e7111dc4dc1d9d987bd5dcbf89c82b9ee8 | ||
Author: Keno Fischer <[email protected]> | ||
Date: Sun Dec 29 15:08:13 2019 -0500 | ||
|
||
win32: Don't run cleanup if we're about to exit anyway | ||
|
||
If the process is about to exit, there's no point trying to do | ||
a bunch of work to clean up resources. The kernel will release | ||
them much more efficiently when the process exits at the end | ||
of this function. | ||
|
||
diff --git a/exports/dllinit.c b/exports/dllinit.c | ||
index 4a05c0e1..88f9af65 100644 | ||
--- a/exports/dllinit.c | ||
+++ b/exports/dllinit.c | ||
@@ -50,7 +50,10 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) { | ||
gotoblas_init(); | ||
break; | ||
case DLL_PROCESS_DETACH: | ||
- gotoblas_quit(); | ||
+ // If the process is about to exit, don't bother releasing any resources | ||
+ // The kernel is much better at bulk releasing then. | ||
+ if (!reserved) | ||
+ gotoblas_quit(); | ||
break; | ||
case DLL_THREAD_ATTACH: | ||
break; |