X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fposix%2FSignals.c;h=c1ffb5d2cfaa6f7a703d8e8acc5cb9cb9e6bf487;hb=9211ec0183bbe923ec6c5997fa695e5f5a3eefab;hp=8268e6fe7444b581f6abc8db0dec70beb9e85b1e;hpb=1e0f31543a0ee99c712c517de2bb1053e046b8db;p=ghc-hetmet.git diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index 8268e6f..c1ffb5d 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -102,20 +102,24 @@ setIOManagerPipe (int fd) void ioManagerWakeup (void) { + int r; // Wake up the IO Manager thread by sending a byte down its pipe if (io_manager_pipe >= 0) { StgWord8 byte = (StgWord8)IO_MANAGER_WAKEUP; - write(io_manager_pipe, &byte, 1); + r = write(io_manager_pipe, &byte, 1); + if (r == -1) { sysErrorBelch("ioManagerWakeup: write"); } } } void ioManagerDie (void) { + int r; // Ask the IO Manager thread to exit if (io_manager_pipe >= 0) { StgWord8 byte = (StgWord8)IO_MANAGER_DIE; - write(io_manager_pipe, &byte, 1); + r = write(io_manager_pipe, &byte, 1); + if (r == -1) { sysErrorBelch("ioManagerDie: write"); } close(io_manager_pipe); io_manager_pipe = -1; } @@ -214,7 +218,7 @@ generic_handler(int sig USED_IF_THREADS, stg_exit(EXIT_FAILURE); } - MainCapability.context_switch = 1; + contextSwitchCapability(&MainCapability); #endif /* THREADED_RTS */ }