From a55821a2ec514ca0a20a07e436bcc82d2f9c962e Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Sat, 11 Aug 2012 21:33:15 +0800 Subject: [PATCH] Refs #132. Kill the threads when unload the library. --- driver/others/blas_server.c | 2 +- driver/others/blas_server_win32.c | 2 +- driver/others/memory.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/driver/others/blas_server.c b/driver/others/blas_server.c index 66067a05c..f16b827d3 100644 --- a/driver/others/blas_server.c +++ b/driver/others/blas_server.c @@ -435,7 +435,7 @@ static int blas_thread_server(void *arg){ blas_memory_free(buffer); - pthread_exit(NULL); + //pthread_exit(NULL); return 0; } diff --git a/driver/others/blas_server_win32.c b/driver/others/blas_server_win32.c index c71e7c276..16eed4c97 100644 --- a/driver/others/blas_server_win32.c +++ b/driver/others/blas_server_win32.c @@ -433,7 +433,7 @@ int exec_blas(BLASLONG num, blas_queue_t *queue){ /* Shutdown procedure, but user don't have to call this routine. The */ /* kernel automatically kill threads. */ -int blas_thread_shutdown_(void){ +int BLASFUNC(blas_thread_shutdown)(void){ int i; diff --git a/driver/others/memory.c b/driver/others/memory.c index af9b54eff..ff8cc248b 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -1289,6 +1289,7 @@ void DESTRUCTOR gotoblas_quit(void) { moncontrol (1); #endif + blas_shutdown(); } #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64))