From: wolfgang Date: Fri, 19 Sep 2003 18:56:00 +0000 (+0000) Subject: [project @ 2003-09-19 18:56:00 by wolfgang] X-Git-Tag: Approx_11550_changesets_converted~440 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=79ff5ead125b16bebb4aac763e703f3847c9b657;p=ghc-hetmet.git [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). --- 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