diff options
author | sof <unknown> | 1999-05-21 14:46:21 +0000 |
---|---|---|
committer | sof <unknown> | 1999-05-21 14:46:21 +0000 |
commit | 263aaaa57bf5564d06de6a87ebccb980b1b5d285 (patch) | |
tree | 2589b5d52d7c03d4f4bd1aa5bb4963adff7eebd2 /ghc/includes/SchedAPI.h | |
parent | 472e4418fa0fe51627a51d15e040bd6cfa17ef62 (diff) | |
download | haskell-263aaaa57bf5564d06de6a87ebccb980b1b5d285.tar.gz |
[project @ 1999-05-21 14:46:19 by sof]
Made rts_evalIO() stricter, i.e.,
rts_evalIO( action );
will now essentially cause `action' to be applied
to the following (imaginary) defn of `evalIO':
evalIO :: IO a -> IO a
evalIO action = action >>= \ x -> x `seq` return x
instead of just
evalIO :: IO a -> IO a
evalIO action = action >>= \ x -> return x
The old, lazier behaviour is now available via rts_evalLazyIO().
Diffstat (limited to 'ghc/includes/SchedAPI.h')
-rw-r--r-- | ghc/includes/SchedAPI.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ghc/includes/SchedAPI.h b/ghc/includes/SchedAPI.h index 27745272da..26dac54e76 100644 --- a/ghc/includes/SchedAPI.h +++ b/ghc/includes/SchedAPI.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: SchedAPI.h,v 1.2 1998/12/02 13:21:33 simonm Exp $ + * $Id: SchedAPI.h,v 1.3 1999/05/21 14:46:21 sof Exp $ * * (c) The GHC Team 1998 * @@ -26,7 +26,7 @@ typedef enum { SchedulerStatus schedule(StgTSO *main_thread, /*out*/StgClosure **ret); /* - * Creating thraeds + * Creating threads */ StgTSO *createThread (nat stack_size); @@ -57,6 +57,21 @@ createIOThread(nat stack_size, StgClosure *closure) { return t; } +/* + * Same as above, but also evaluate the result of the IO action + * to whnf while we're at it. + */ + +static inline StgTSO * +createStrictIOThread(nat stack_size, StgClosure *closure) { + StgTSO *t; + t = createThread(stack_size); + pushClosure(t,closure); + pushClosure(t,&forceIO_closure); + return t; +} + + /* * Killing threads */ |