]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml : release the requested thread pool resource (#3292)
authorQu Zongfu <redacted>
Thu, 28 Sep 2023 19:51:52 +0000 (03:51 +0800)
committerGitHub <redacted>
Thu, 28 Sep 2023 19:51:52 +0000 (22:51 +0300)
* Release the requested thread pool resource

* Release the requested thread pool resource 2

---------

Co-authored-by: Zongfu ZF3 Qu <redacted>
ggml.c

diff --git a/ggml.c b/ggml.c
index ea964babd2c3519da3450a4162ef54e2bd1e3890..078b2c42252b270ed39981361abb8f047b6d1bff 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -89,7 +89,9 @@ static int pthread_create(pthread_t * out, void * unused, thread_ret_t(*func)(vo
 
 static int pthread_join(pthread_t thread, void * unused) {
     (void) unused;
-    return (int) WaitForSingleObject(thread, INFINITE);
+    int ret = (int) WaitForSingleObject(thread, INFINITE);
+    CloseHandle(thread);
+    return ret;
 }
 
 static int sched_yield (void) {