summaryrefslogtreecommitdiff
path: root/rts/posix/Signals.h
Commit message (Collapse)AuthorAgeFilesLines
* rts: add Emacs 'Local Variables' to every .c fileAustin Seipp2014-07-281-0/+8
| | | | | | | | This will hopefully help ensure some basic consistency in the forward by overriding buffer variables. In particular, it sets the wrap length, the offset to 4, and turns off tabs. Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace Signals.hAustin Seipp2014-07-281-1/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Make forkProcess work with +RTS -NSimon Marlow2011-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | Consider this experimental for the time being. There are a lot of things that could go wrong, but I've verified that at least it works on the test cases we have. I also did some API cleanups while I was here. Previously we had: Capability * rts_eval (Capability *cap, HaskellObj p, /*out*/HaskellObj *ret); but this API is particularly error-prone: if you forget to discard the Capability * you passed in and use the return value instead, then you're in for subtle bugs with +RTS -N later on. So I changed all these functions to this form: void rts_eval (/* inout */ Capability **cap, /* in */ HaskellObj p, /* out */ HaskellObj *ret) It's much harder to use this version incorrectly, because you have to pass the Capability in by reference.
* Fix the symbol visibility pragmasSimon Marlow2010-06-171-2/+2
|
* The rest of the #1185 patch (forkProcess and -threaded)Simon Marlow2009-11-131-0/+2
| | | | | Due to darcs confusion, I managed to leave out part of the patch for #1185. This should make 1185(threaded1) go through now.
* Rollback #1185 fixSimon Marlow2009-11-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As far as I can tell, the hack I was using in rts/Linker.c won't work on OS X. Back to the drawing board. rolling back: Tue Nov 3 16:05:47 GMT 2009 Simon Marlow <marlowsd@gmail.com> * Fix #1185 (RTS part, also needs corresponding change to libraries/base) GHC.Conc.ensureIOManagerIsRunning now creates an IO manager thread if one does not exist or has died/exited. Unfortunately this exposed a problem caused by the fact that we have two base packages, and hence two IO managers, in GHCi: see NOTE [io-manager-ghci] in rts/Linker.c. The workaround can go away if/when we switch to a dynamically linked GHCi. M ./rts/Linker.c -6 +47 M ./rts/Schedule.c +4 M ./rts/package.conf.in +16 M ./rts/posix/Signals.c -1 +7 M ./rts/posix/Signals.h +2 Wed Nov 4 10:11:03 GMT 2009 Simon Marlow <marlowsd@gmail.com> * hopefully fix validate breakage on OS X and Windows M ./rts/Linker.c -1 +1 Wed Nov 4 16:27:40 GMT 2009 Simon Marlow <marlowsd@gmail.com> * fix build failure on Windows M ./rts/Linker.c -1 +1
* Fix #1185 (RTS part, also needs corresponding change to libraries/base)Simon Marlow2009-11-031-0/+2
| | | | | | | | | | | GHC.Conc.ensureIOManagerIsRunning now creates an IO manager thread if one does not exist or has died/exited. Unfortunately this exposed a problem caused by the fact that we have two base packages, and hence two IO managers, in GHCi: see NOTE [io-manager-ghci] in rts/Linker.c. The workaround can go away if/when we switch to a dynamically linked GHCi.
* Omit visibility pragmas on Windows (fixes warnings/validate failures)Simon Marlow2009-09-091-2/+2
|
* Declare RTS-private prototypes with __attribute__((visibility("hidden")))Simon Marlow2009-08-051-1/+5
| | | | | | | | | | This has no effect with static libraries, but when the RTS is in a shared library it does two things: - it prevents the function from being exposed by the shared library - internal calls to the function can use the faster non-PLT calls, because the function cannot be overriden at link time.
* Rewrite of signal-handling (ghc patch; see also base and unix patches)Simon Marlow2009-02-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The API is the same (for now). The new implementation has the capability to define signal handlers that have access to the siginfo of the signal (#592), but this functionality is not exposed in this patch. #2451 is the ticket for the new API. The main purpose of bringing this in now is to fix race conditions in the old signal handling code (#2858). Later we can enable the new API in the HEAD. Implementation differences: - More of the signal-handling is moved into Haskell. We store the table of signal handlers in an MVar, rather than having a table of StablePtrs in the RTS. - In the threaded RTS, the siginfo of the signal is passed down the pipe to the IO manager thread, which manages the business of starting up new signal handler threads. In the non-threaded RTS, the siginfo of caught signals is stored in the RTS, and the scheduler starts new signal handler threads.
* Add support for the IO manager thread on WindowsSimon Marlow2006-12-011-6/+0
| | | | | | | | | | | | | | | | | | | Fixes #637. The implications of this change are: - threadDelay on Windows no longer creates a new OS thread each time, instead it communicates with the IO manager thread in the same way as on Unix. - deadlock detection now works the same way on Windows as on Unix; that is the timer interrupt wakes up the IO manager thread, which causes the scheduler to check for deadlock. - Console events now get sent to the IO manager thread, in the same way as signals do on Unix. This means that console events should behave more reliably with -threaded on Windows. All this applies only with -threaded. Without -threaded, the old ConsoleEvent code is still used. After some testing, this could be pushed to the 6.6 branch.
* Better control of the IO manager thread; improvements to deadlock checkingSimon Marlow2006-05-241-1/+5
| | | | | | | | | | | | | | | | | In the threaded RTS on *nix platforms: - we now start the IO manager thread eagerly at startup time (previously was started on demand). - we now ask the IO manager thread to stop at shutdown - In Timer.c:handle_tick, if it looks like we might be in a deadlock, instead of calling prodOneCapability() which was known to be wrong, we now send a byte down the IO manager's pipe to wake it up. This also avoids a case of double-acquisition of a mutex, which happened if prodOneCapability() was called while the current thread was holding a mutex.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+26
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.