X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=rts%2Fposix%2FSignals.c;h=c1ffb5d2cfaa6f7a703d8e8acc5cb9cb9e6bf487;hb=ef70af356e3229cc5c64359bf7866e5fdf44bb09;hp=c016b9bf75136fae28e6047bf05b72554dbf955e;hpb=7ed3f7556f46b957f7efb97ed7ebdc92db2f8ab7;p=ghc-hetmet.git diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index c016b9b..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; } @@ -155,8 +159,6 @@ generic_handler(int sig USED_IF_THREADS, siginfo_t *info, void *p STG_UNUSED) { - sigset_t signals; - #if defined(THREADED_RTS) if (io_manager_pipe != -1) @@ -216,14 +218,9 @@ generic_handler(int sig USED_IF_THREADS, stg_exit(EXIT_FAILURE); } - MainCapability.context_switch = 1; + contextSwitchCapability(&MainCapability); #endif /* THREADED_RTS */ - - // re-establish the signal handler, and carry on - sigemptyset(&signals); - sigaddset(&signals, sig); - sigprocmask(SIG_UNBLOCK, &signals, NULL); } /* -----------------------------------------------------------------------------