From 79ff5ead125b16bebb4aac763e703f3847c9b657 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Fri, 19 Sep 2003 18:56:00 +0000 Subject: [PATCH] [project @ 2003-09-19 18:56:00 by wolfgang] POSIX threads should be pthread_detach-ed after they are created. Otherwise they'll stick around waiting for a pthread_join. (This wasn't really a problem because our worker threads never exit anyway). --- ghc/rts/OSThreads.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghc/rts/OSThreads.c b/ghc/rts/OSThreads.c index 01e0a25..739090d 100644 --- a/ghc/rts/OSThreads.c +++ b/ghc/rts/OSThreads.c @@ -78,7 +78,10 @@ startProcWrapper(void* pProc) int createOSThread ( OSThreadId* pId, void (*startProc)(void)) { - return pthread_create(pId, NULL, startProcWrapper, (void*)startProc); + int result = pthread_create(pId, NULL, startProcWrapper, (void*)startProc); + if(!result) + pthread_detach(*pId); + return result; } OSThreadId -- 1.7.10.4