X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FSelect.c;h=d7e6ffcdaa90e1acc319918d4fc26ba89afbc702;hb=deb02bba366a14249113b97223c36c9bec8e384e;hp=70e0a0349cb60b64b2a690c9cf075d91b9f4384b;hpb=c49a6ca90100722cd6942322d32b64b4142a08a7;p=ghc-hetmet.git diff --git a/ghc/rts/Select.c b/ghc/rts/Select.c index 70e0a03..d7e6ffc 100644 --- a/ghc/rts/Select.c +++ b/ghc/rts/Select.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Select.c,v 1.28 2003/04/01 15:05:22 sof Exp $ + * $Id: Select.c,v 1.30 2003/10/01 10:49:09 wolfgang Exp $ * * (c) The GHC Team 1995-2002 * @@ -31,6 +31,10 @@ #include #include +#ifdef HAVE_UNISTD_H +#include +#endif + /* last timestamp */ nat timestamp = 0; @@ -347,4 +351,20 @@ wakeBlockedWorkerThread() workerWakeupPending = rtsTrue; } } + +/* resetWorkerWakeupPipeAfterFork + * + * To be called right after a fork(). + * After the fork(), the worker wakeup pipe will be shared + * with the parent process, and that's something we don't want. + */ +void +resetWorkerWakeupPipeAfterFork() +{ + if(workerWakeupInited) { + close(workerWakeupPipe[0]); + close(workerWakeupPipe[1]); + } + workerWakeupInited = rtsFalse; +} #endif