Ticket #1364: fix1364-base.2.patch

File fix1364-base.2.patch, 28.6 KB (added by Svarog, 9 years ago)
1Tue Oct 21 19:18:59 EST 2008  Ivan Tomac <tomac@pacific.net.au>
2  * FIX #1364: added support for C finalizers that run as soon as the value is no longer reachable.
4New patches:
6[FIX #1364: added support for C finalizers that run as soon as the value is no longer reachable.
7Ivan Tomac <tomac@pacific.net.au>**20081021081859] {
8hunk ./Foreign/ForeignPtr.hs 155
9-#ifdef __GLASGOW_HASKELL__
10-type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> IO ())
12--- | like 'addForeignPtrFinalizerEnv' but allows the finalizer to be
13--- passed an additional environment parameter to be passed to the
14--- finalizer.  The environment passed to the finalizer is fixed by the
15--- second argument to 'addForeignPtrFinalizerEnv'
16-addForeignPtrFinalizerEnv ::
17-  FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
18-addForeignPtrFinalizerEnv finalizer env fptr =
19-  addForeignPtrConcFinalizer fptr
20-        (mkFinalizerEnv finalizer env (unsafeForeignPtrToPtr fptr))
22-foreign import ccall "dynamic"
23-  mkFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO ()
27hunk ./GHC/ForeignPtr.hs 22
28+        FinalizerEnvPtr,
29hunk ./GHC/ForeignPtr.hs 28
30-        addForeignPtrFinalizer,
31+        addForeignPtrFinalizer,
32+        addForeignPtrFinalizerEnv,
33hunk ./GHC/ForeignPtr.hs 47
34-import GHC.Ptr          ( Ptr(..), FunPtr )
35+import GHC.Ptr          ( Ptr(..), FunPtr(..) )
36hunk ./GHC/ForeignPtr.hs 81
37+data Finalizers
38+  = NoFinalizers
39+  | CFinalizers
40+  | HaskellFinalizers
41+    deriving Eq
43hunk ./GHC/ForeignPtr.hs 88
44-  = PlainForeignPtr !(IORef [IO ()])
45-  | MallocPtr      (MutableByteArray# RealWorld) !(IORef [IO ()])
46+  = PlainForeignPtr !(IORef (Finalizers, [IO ()]))
47+  | MallocPtr      (MutableByteArray# RealWorld) !(IORef (Finalizers, [IO ()]))
48hunk ./GHC/ForeignPtr.hs 106
49-type FinalizerPtr a = FunPtr (Ptr a -> IO ())
50+type FinalizerPtr a        = FunPtr (Ptr a -> IO ())
51+type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> IO ())
52hunk ./GHC/ForeignPtr.hs 153
53-          r <- newIORef []
54+          r <- newIORef (NoFinalizers, [])
55hunk ./GHC/ForeignPtr.hs 165
56-  r <- newIORef []
57+  r <- newIORef (NoFinalizers, [])
58hunk ./GHC/ForeignPtr.hs 210
59-addForeignPtrFinalizer finalizer fptr =
60-  addForeignPtrConcFinalizer fptr
61-        (mkFinalizer finalizer (unsafeForeignPtrToPtr fptr))
62+addForeignPtrFinalizer (FunPtr fp) (ForeignPtr p c) = case c of
63+  PlainForeignPtr r -> f r >> return ()
64+  MallocPtr     _ r -> f r >> return ()
65+  _ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"
66+  where
67+    f r =
68+      noMixing CFinalizers r $
69+        IO $ \s ->
70+          case r of { IORef (STRef r#) ->
71+          case mkWeakForeign# r# () fp p s of { (# s1, w #) ->
72+          (# s1, finalizeForeign w #) }}
74+addForeignPtrFinalizerEnv ::
75+  FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
76+-- ^ like 'addForeignPtrFinalizerEnv' but allows the finalizer to be
77+-- passed an additional environment parameter to be passed to the
78+-- finalizer.  The environment passed to the finalizer is fixed by the
79+-- second argument to 'addForeignPtrFinalizerEnv'
80+addForeignPtrFinalizerEnv (FunPtr fp) (Ptr ep) (ForeignPtr p c) = case c of
81+  PlainForeignPtr r -> f r >> return ()
82+  MallocPtr     _ r -> f r >> return ()
83+  _ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"
84+  where
85+    f r =
86+      noMixing CFinalizers r $
87+        IO $ \s ->
88+          case r of { IORef (STRef r#) ->
89+          case mkWeakForeignEnv# r# () fp p ep s of { (# s1, w #) ->
90+          (# s1, finalizeForeign w #) }}
92+finalizeForeign :: Weak# () -> IO ()
93+finalizeForeign w = IO $ \s ->
94+  case finalizeWeak# w s of
95+    (# s1, 0#, _ #) -> (# s1, () #)
96+    (# s1, _ , f #) -> f s1
97hunk ./GHC/ForeignPtr.hs 266
98-  fs <- readIORef r
99-  writeIORef r (finalizer : fs)
100-  if (null fs)
101+  noFinalizers <- noMixing HaskellFinalizers r (return finalizer)
102+  if noFinalizers
103hunk ./GHC/ForeignPtr.hs 273
104-addForeignPtrConcFinalizer_ f@(MallocPtr fo r) finalizer = do
105-  fs <- readIORef r
106-  writeIORef r (finalizer : fs)
107-  if (null fs)
108+addForeignPtrConcFinalizer_ f@(MallocPtr fo r) finalizer = do
109+  noFinalizers <- noMixing HaskellFinalizers r (return finalizer)
110+  if noFinalizers
111hunk ./GHC/ForeignPtr.hs 284
112-foreign import ccall "dynamic"
113-  mkFinalizer :: FinalizerPtr a -> Ptr a -> IO ()
114+noMixing ::
115+  Finalizers -> IORef (Finalizers, [IO ()]) -> IO (IO ()) -> IO Bool
116+noMixing ftype0 r mkF = do
117+  (ftype, fs) <- readIORef r
118+  if ftype /= NoFinalizers && ftype /= ftype0
119+     then error ("GHC.ForeignPtr: attempt to mix Haskell and C finalizers " ++
120+                 "in the same ForeignPtr")
121+     else do
122+       f <- mkF
123+       writeIORef r (ftype0, f : fs)
124+       return (null fs)
125hunk ./GHC/ForeignPtr.hs 296
126-foreignPtrFinalizer :: IORef [IO ()] -> IO ()
127-foreignPtrFinalizer r = do fs <- readIORef r; sequence_ fs
128+foreignPtrFinalizer :: IORef (Finalizers, [IO ()]) -> IO ()
129+foreignPtrFinalizer r = do (_, fs) <- readIORef r; sequence_ fs
130hunk ./GHC/ForeignPtr.hs 303
131-  r <- newIORef []
132+  r <- newIORef (NoFinalizers, [])
133hunk ./GHC/ForeignPtr.hs 363
134-        finalizers <- readIORef refFinalizers
135+        (ftype, finalizers) <- readIORef refFinalizers
136hunk ./GHC/ForeignPtr.hs 365
137-        writeIORef refFinalizers []
138+        writeIORef refFinalizers (ftype, [])
143[docs about how exceptions are handled by forkIO'd threads (#2651)
144Simon Marlow <marlowsd@gmail.com>**20081016100410]
145[Import n_capabilities via import symbol when linking dynamically
146Clemens Fruhwirth <clemens@endorphin.org>**20081013161220]
147[add link to the new syb wiki
149[changing haddock links
151[add readTVarIO :: TVar a -> IO a
152Simon Marlow <marlowsd@gmail.com>**20081010113835]
153[removed (->) instance from Data.Data
155[non-GHC: delete unnecessary imports
156Ross Paterson <ross@soi.city.ac.uk>**20081007134809]
157[added new module Data.Data
158'Jose Pedro Magalhaes <jpm@cs.uu.nl>'**20081002140535
160 The new Data.Data module contains all of Data.Generics.Basics
161 and most of Data.Generics.Instances. The missing instances were
162 deemed dubious and moved to the syb package.
164[add new Data.Data module
165'Jose Pedro Magalhaes <jpm@cs.uu.nl>'**20081002082735]
166[restore Complex's derived Data instance
167'Jose Pedro Magalhaes <jpm@cs.uu.nl>'**20081002082655]
168[update Data.Generics import
169'Jose Pedro Magalhaes <jpm@cs.uu.nl>'**20081002082604]
170[Don't use ^(2::Int) in Data.Complex.magnitude; partially fixes trac #2450
171Ian Lynagh <igloo@earth.li>**20081004142651
172 We still might want to make a RULE for this, so the bug is not fully fixed.
174[Restore the Haskell 98 behaviour of Show Ratio (#1920)
175Simon Marlow <simonmarhaskell@gmail.com>**20080923134949]
176[Pad version number to
177Ian Lynagh <igloo@earth.li>**20080920155801]
178[TAG 6.10 branch has been forked
179Ian Lynagh <igloo@earth.li>**20080919123437]
180[In nhc98, Word is a type synonym, so class instance is not possible.
182[Fix bugs in Text.Printf (#1548)
183Simon Marlow <marlowsd@gmail.com>**20080916133505]
184[We should be including Rts.h here, not Stg.h
185Simon Marlow <marlowsd@gmail.com>**20080912134901
186 Stg.h is for .hc files only, and it sets up various global register
187 variables.
189[Generic functions that take integral arguments should work the same way as their prelude counterparts
192 The Prelude functions drop, take, and splitAt are unfailing (never call error). This patch changes the Data.List generic versions to behave the same way. At present, they call error on negative arguments.
195[Don't define __hscore_s_issock on Windows
196Ian Lynagh <igloo@earth.li>**20080904202845]
197[Unbreak the GHC build with older versions of gcc
198Ian Lynagh <igloo@earth.li>**20080904185122
199 Patch from kili@outback.escape.de, who says:
200   Stg.h must be included before HsBase.h, because the latter contains
201   function definitions causing older versions of gcc (3.3.5 in my
202   case) to bail out with "error: global register variable follows a
203   function definition" on Regs.h, which is included by Stg.h.
205[Don't make S_ISSOCK use conditional
206Ian Lynagh <igloo@earth.li>**20080904164234
207 We were conditionally defining the C wrapper, but unconditionally using
208 it. So if it didn't exist then things would have broken anyway.
210[Add missing files
211Ian Lynagh <igloo@earth.li>**20080904100951]
212[Remerge concurrent,unique,timeout,st,getopt into base
213Ian Lynagh <igloo@earth.li>**20080903201908]
214[remove 'pure' method from Arrow class (#2517)
215Ross Paterson <ross@soi.city.ac.uk>**20080903144436]
216[make Typeable instances for larger tuples available to non-GHC
217Ross Paterson <ross@soi.city.ac.uk>**20080903113543]
218[Don't look for actual OldException.Exception exceptions
219Ian Lynagh <igloo@earth.li>**20080902224730
220 We don't actually throw them (we throw the new Exception equivalents
221 instead), and looking for them was causing an infinite loop
223[add include/CTypes.h to extra-source-files
224Ross Paterson <ross@soi.city.ac.uk>**20080902153029]
225[avoid relying on the implementation of SomeException
226Ross Paterson <ross@soi.city.ac.uk>**20080902080113
228 This is because Hugs uses a different implementation.
229 No semantic change.
231[non-GHC: leave out Belch functions
232Ross Paterson <ross@soi.city.ac.uk>**20080831180227]
233[non-GHC: add Typeable instance for ForeignPtr
234Ross Paterson <ross@soi.city.ac.uk>**20080831180048]
235[docs: mention that killThread on a completed thread is a no-op
236Simon Marlow <marlowsd@gmail.com>**20080902093126]
237[#2528: reverse the order of args to (==) in nubBy to match nub
238Simon Marlow <marlowsd@gmail.com>**20080902092950
239 This only makes a difference when the (==) definition is not
240 reflexive, but strictly speaking it does violate the report definition
241 of nubBy, so we should fix it.
243[System.Timeout is no longer part of base
245[getopt is no longer part of base
247[Split syb off into its own package
248Ian Lynagh <igloo@earth.li>**20080825214144
249 I've also moved the Data (Complex a) instance into it, and made it
250 portable rather than GHC-only in the process.
252[add extra-source-files field
253Ross Paterson <ross@soi.city.ac.uk>**20080825231317]
254[Fix warnings in PrelIOUtils.c
255Ian Lynagh <igloo@earth.li>**20080825141841]
256[Windows-only fixes for moving concurrent out of base
257Ian Lynagh <igloo@earth.li>**20080824164146]
258[Split off the concurrent hierarchy (concurrent, unique, timeout)
259Ian Lynagh <igloo@earth.li>**20080824123956]
260[Split getopt off into its own package
261Ian Lynagh <igloo@earth.li>**20080824020213]
262[Remove ST stuff that is now in the new st package
263Ian Lynagh <igloo@earth.li>**20080823223014]
264[Fix Windows-only warnings
265Ian Lynagh <igloo@earth.li>**20080823002249]
266[Fix Windows-only warnings in GHC.Conc
267Ian Lynagh <igloo@earth.li>**20080822234837]
268[Suppress some warnings that are hard to fix because of ifdefs
269Ian Lynagh <igloo@earth.li>**20080822233951]
270[Provide blockedOnDeadMVar, blockedIndefinitely for the RTS
271Ian Lynagh <igloo@earth.li>**20080821110723]
272[Fix more warnings
273Ian Lynagh <igloo@earth.li>**20080820233958]
274[Suppress a couple of warnings in GHC.PArr
275Ian Lynagh <igloo@earth.li>**20080820232018
276 The fix isn't immediately obvious to me
278[Fix more warnings
279Ian Lynagh <igloo@earth.li>**20080820231937]
280[Fix warnings in Data.Generics.*
281Ian Lynagh <igloo@earth.li>**20080820230437]
282[Fix some more warnings
283Ian Lynagh <igloo@earth.li>**20080820223252]
284[Ignore some orphan warnings
285Ian Lynagh <igloo@earth.li>**20080820211901]
286[remove some functions that aren't used in base
287Simon Marlow <marlowsd@gmail.com>**20080821142339]
288[remove __hscore_renameFile, it is no longer uesd
289Simon Marlow <marlowsd@gmail.com>**20080818155950
290 System.Directory implements renameFile using unix/Win32 now.
292[Rewrite the documentation for forkOS again
293Simon Marlow <marlowsd@gmail.com>**20080818132856
294 Try to make it clearer that forkOS is only necessary when calling
295 foreing libraries that use thread-local state, and it has nothing to
296 do with scheduling behaviour between Haskell threads.  I also added
297 something about the performance impact of forkOS, and mentioned that
298 the main thread is a bound thread.
300[nhc only: expose Foldable and Traversable instances of Array
301Ross Paterson <ross@soi.city.ac.uk>**20080817002719
303 These were turned off as a side-effect of a previous nhc-only fix for
304 #2176 that is no longer needed.  They should be fine for nhc now.
306[Fix hReady (trac #1063)
307Ian Lynagh <igloo@earth.li>**20080816182715
308 We now throw an EOF exception when appropriate
310[Fix oversight in Control.OldException
311Bertram Felgenhauer <int-e@gmx.de>**20080816132631
312 The NonTermination constructor slipped through in the Exception instance.
314[Eliminate orphan rules and instances in the array package
315Ian Lynagh <igloo@earth.li>**20080816122253]
316[Control.OldException: Map exceptions to old exceptions and back properly.
317Ian Lynagh <igloo@earth.li>**20080814210219
318   * Control.OldException: Map exceptions to old exceptions and back properly.
320 It's really necessary to map them back as well, or the RTS and base library
321 will not recognize exceptions that got caught and rethrown. (See #2508)
323 Patch from Bertram Felgenhauer <int-e@gmx.de>
325[add Traversable generalizations of mapAccumL and mapAccumR (#2461)
326Ross Paterson <ross@soi.city.ac.uk>**20080814162617]
327[simplify definition of Prelude.catch
328Ross Paterson <ross@soi.city.ac.uk>**20080814143650]
329[remove returns from void functions
330Ross Paterson <ross@soi.city.ac.uk>**20080814110841]
331[No reason for Handler and catches to exclude nhc98.
333[Must import ExitCode for its instance to be re-exported.
335 The Cabal library depends on "instance Exception ExitCode", and expects
336 to import it from Control.Exception, not Control.Exception.Base.
338[use New.catch instead of catchException in OldException
339Ross Paterson <ross@soi.city.ac.uk>**20080813071307]
340[use the Haskell 98 module Control.Exception.Base in the Concurrent modules
341Ross Paterson <ross@soi.city.ac.uk>**20080813000219]
342[export Control.Exception.Base
343Ross Paterson <ross@soi.city.ac.uk>**20080812233640]
344[use dummy implementation of timeout for all non-GHCs
345Ross Paterson <ross@soi.city.ac.uk>**20080812151602]
346[Hugs only: fix imports
347Ross Paterson <ross@soi.city.ac.uk>**20080812145654]
348[non-GHC: hide Prelude.catch
349Ross Paterson <ross@soi.city.ac.uk>**20080812145622]
350[add Control.Exception.Base to nhc98 build
352[bump to version 4.0
353Simon Marlow <marlowsd@gmail.com>**20080805153354]
354[Hugs only: don't import exception types -- their instances are now in Control.Exception.Base
355Ross Paterson <ross@soi.city.ac.uk>**20080812140433]
356[split most of Control.Exception into new Control.Exception.Base
357Ross Paterson <ross@soi.city.ac.uk>**20080812124912
359 Move everything but catches/Handler into a new internal module.
360 This was needed to get the new exceptions working with Hugs, because Hugs
361 has the constraint that all Haskell 98 library modules, and everything
362 they include, must be Haskell 98.  This also involves a different
363 representation of SomeException for Hugs, so that type is exported
364 opaquely for Hugs.  Then Control.Exception.Base is Haskell 98 as far as
365 Hugs is concerned, but Control.Exception needs the extensions turned on.
367 Control.Exception re-exports everything from Control.Exception.Base
368 except the functions used by the GHC runtime.
370[remove kludges, now that Control.Exception is imported
371Ross Paterson <ross@soi.city.ac.uk>**20080811180328]
372[threadDelay and friends are GHC-only
373Ross Paterson <ross@soi.city.ac.uk>**20080811175039]
374[fix imports for non-GHC
376[Eq and Ord have moved into GHC.Classes
377Ian Lynagh <igloo@earth.li>**20080807095352]
378[Use the proper CInt type in GHC.Unicode
379Ian Lynagh <igloo@earth.li>**20080806232948]
380[Import wibbles
381Ian Lynagh <igloo@earth.li>**20080806232055]
382[Remove unnecessary Data/Dynamic.hs-boot
383Ian Lynagh <igloo@earth.li>**20080806230623]
384[Remove more redundant GHC.Float imports
385Ian Lynagh <igloo@earth.li>**20080806225411]
386[Remove an unnecessary import
387Ian Lynagh <igloo@earth.li>**20080806224742]
388[Move Int, Float and Double into ghc-prim:GHC.Types
389Ian Lynagh <igloo@earth.li>**20080806191554]
390[Put some explicit import lists in Data.Typeable
391Ian Lynagh <igloo@earth.li>**20080806190353]
392[Fix a couple of imports
393Ian Lynagh <igloo@earth.li>**20080806165549]
394[Remove unused conditional import
395Ian Lynagh <igloo@earth.li>**20080806124930]
396[Swap imports around to get GHC.ForeignPtr out of the base knot
397Ian Lynagh <igloo@earth.li>**20080806121313]
398[Move some bits around to stop Data.Either being in the base import knot
399Ian Lynagh <igloo@earth.li>**20080806120504]
400[Tweak an import
401Ian Lynagh <igloo@earth.li>**20080806000440]
402[Remove the DynIOError constructor of IOErrorType
403Ian Lynagh <igloo@earth.li>**20080805234720
404 As far as I can see it is never used or exported
406[Move some internals around to simplify the import graph a bit
407Ian Lynagh <igloo@earth.li>**20080805221341]
408[Move the Char datatype into ghc-prim
409Ian Lynagh <igloo@earth.li>**20080805204009]
410[Remove an unnecessary import
411Ian Lynagh <igloo@earth.li>**20080805182336]
412[The [] definition has moved to ghc-prim
413Ian Lynagh <igloo@earth.li>**20080805182332]
414[Fix warnings
415Ian Lynagh <igloo@earth.li>**20080805150250]
416[Add a missing case to Show AsyncException
417Ian Lynagh <igloo@earth.li>**20080805142811]
418[Remove GHC.Dotnet
419Ian Lynagh <igloo@earth.li>**20080804215840]
420[Hide standalone deriving clauses from haddock
421Ian Lynagh <igloo@earth.li>**20080804211617]
422[Control.Exception doesn't need to export assertError
423Ian Lynagh <igloo@earth.li>**20080804161838]
424[Generalise the type of mapException; pointed out by Isaac Dupree
425Ian Lynagh <igloo@earth.li>**20080804160941]
426[Remove some unnecessary Data.Tuple imports
427Ian Lynagh <igloo@earth.li>**20080804155956]
428[The tuple datatype definitions have moved to ghc-prim
429Ian Lynagh <igloo@earth.li>**20080804155420]
430[make ExitCode an instance of Exception for nhc98
432[poke and peek come from Foreign.Storable
434[zipWithM_ comes from Control.Monad
436[Fix nhc98 code variations to use the extensible exception API.
438 There is still only one real exception type in nhc98, so it is not truly
439 extensible.  But this is enough to get the base package building again.
441[nhc98 needs the Prelude for this module
443[Change some imports and derive Show (Either a b)
444Ian Lynagh <igloo@earth.li>**20080804004147
445 rather than writing it by hand in GHC.Show
447[Windows fixes
448Ian Lynagh <igloo@earth.li>**20080803180345]
449[Remove the duplicate definition of throwTo in Control.Exception
450Ian Lynagh <igloo@earth.li>**20080803141703
451 It now imports GHC.Conc, so it is no longer necessary
453[Remove the only import of GHC.Exts
454Ian Lynagh <igloo@earth.li>**20080803141944]
455[Move assertError into GHC.IOBase
456Ian Lynagh <igloo@earth.li>**20080803141040]
457[Use onException rather than catchAny
458Ian Lynagh <igloo@earth.li>**20080803114104]
459[Generalise the type of onException
460Ian Lynagh <igloo@earth.li>**20080803003001
461 The type of the thing to do on an exception is now
462     IO b
463 rather than
464     IO ()
465 which better matches functions like bracket.
467[Remove the dangerous Exception functions
468Ian Lynagh <igloo@earth.li>**20080802231358
469 Removed: catchAny, handleAny, ignoreExceptions
470 These make it easy to eat /any/ exception, which is rarely what you want.
471 Normally you either want to:
472 * only catch exceptions in a certain part of the hierarchy, e.g.
473   "file not found", in which case you should only catch exceptions
474   of the appropriate type,
475 or
476 * you want to do some cleanup when an exception happens, and then rethrow
477   the exception, in which case you should use onException, or one of the
478   bracketing functions.
480[Remove an unused import
481Ian Lynagh <igloo@earth.li>**20080801230343]
482[Remove unused imports
483Ian Lynagh <igloo@earth.li>**20080801230059]
484[Remove unused imports in Control.Exception
485Ian Lynagh <igloo@earth.li>**20080801225847]
486[Get rid of some duplicate imports
487Ian Lynagh <igloo@earth.li>**20080801214933]
488[Remove the now-unused GHC/Conc.lhs-boot
489Ian Lynagh <igloo@earth.li>**20080801214707]
490[Make some more imports non-recursive
491Ian Lynagh <igloo@earth.li>**20080801214546]
492[Rejig some code so Control.Exception and GHC.Conc don't need recursive imports
493Ian Lynagh <igloo@earth.li>**20080801214208]
494[Remove the now-unused GHC/TopHandler.lhs-boot
495Ian Lynagh <igloo@earth.li>**20080801212105]
496[Reshuffle GHC.Conc/GHC.TopHandler a bit to remove a recursive import
497Ian Lynagh <igloo@earth.li>**20080801211801]
498[Don't import Control.Concurrent.MVar in GHC.TopHandler
499Ian Lynagh <igloo@earth.li>**20080801200123]
500[Export assertError from Control.Exception to make GHC happy
501Ian Lynagh <igloo@earth.li>**20080801111716
502 It's a wired-in name in GHC. We should possibly move it to another module.
504[TopHandler now uses the new extensible exceptions
505Ian Lynagh <igloo@earth.li>**20080731153553]
506[Comment wibble
507Ian Lynagh <igloo@earth.li>**20080730202127]
508[Make numericEnumFrom more efficient
509Ian Lynagh <igloo@earth.li>**20080730202049]
510[Put in some parens to clarify how things parse
511Ian Lynagh <igloo@earth.li>**20080730201934]
512[applied patches to make enumFrom and friends strict in arguments as per the Report; closes ticket #1997
513Bart Massey <bart@cs.pdx.edu>**20080726080444]
514[Don't use "deriving Typeable" (for portability reasons)
515Ian Lynagh <igloo@earth.li>**20080730194434]
516[Add onException
517Ian Lynagh <igloo@earth.li>**20080730172014]
518[Fix whitespace
519Ian Lynagh <igloo@earth.li>**20080730171951
520 The space after "\begin{code}" was confusing haddock
522[Re-add blocked; it got lost in the extensible exceptions patches
523Ian Lynagh <igloo@earth.li>**20080730145614]
524[Start to actually use extensible exceptions
525Ian Lynagh <igloo@earth.li>**20080730145115]
526[Rejig the extensible exceptions so there is less circular importing
527Ian Lynagh <igloo@earth.li>**20080730122539]
528[Define nonTermination for the RTS to use
529Ian Lynagh <igloo@earth.li>**20080621144420
530 We'll probably need to do the same for some other exceptions too
532[Use extensible exceptions at the lowest level
533Ian Lynagh <igloo@earth.li>**20080621121501
534 Everything above is largely unchanged; just the type of catch and throw.
536[add comment
537Simon Marlow <marlowsd@gmail.com>**20080730114559]
538[add some big warnings to the docs for unsafeIOToSTM (#2401)
539Simon Marlow <marlowsd@gmail.com>**20080730114554]
540[FIX #2376: inline shiftR
541Simon Marlow <marlowsd@gmail.com>**20080730103539
542 Duplicating the default definition for shiftR doesn't seem quite right
543 to me, but it gets the right results when compiling the example
544 program, and I couldn't find a better way to do it.
546[Add instance Show Control.Exception.Exception for nhc98.
548[Extend nhc98's Exception type to resemble ghc's more closely
550[fix dummy async implementations for non-GHC
551Ross Paterson <ross@soi.city.ac.uk>**20080715125521]
552[Fix haddocking with older haddocks
553Ian Lynagh <igloo@earth.li>**20080710190855]
554[Add threadStatus :: ThreadId -> IO ThreadStatus
555Simon Marlow <marlowsd@gmail.com>**20080710151711
557 -- | The current status of a thread
558 data ThreadStatus
559   = ThreadRunning
560         -- ^the thread is currently runnable or running
561   | ThreadFinished
562         -- ^the thread has finished
563   | ThreadBlocked  BlockReason
564         -- ^the thread is blocked on some resource
565   | ThreadDied
566         -- ^the thread received an uncaught exception
567   deriving (Eq,Ord,Show)
569 data BlockReason
570   = BlockedOnMVar
571         -- ^blocked on on 'MVar'
572   | BlockedOnBlackHole
573         -- ^blocked on a computation in progress by another thread
574   | BlockedOnException
575         -- ^blocked in 'throwTo'
576   | BlockedOnSTM
577         -- ^blocked in 'retry' in an STM transaction
578   | BlockedOnForeignCall
579         -- ^currently in a foreign call
580   | BlockedOnOther
581         -- ^blocked on some other resource.  Without @-threaded@,
582         -- I/O and 'threadDelay' show up as 'BlockedOnOther', with @-threaded@
583         -- they show up as 'BlockedOnMVar'.
584   deriving (Eq,Ord,Show)
586 This is useful for concurrency debugging.  I've left threadStatus in
587 GHC.Conc for now, since the ThreadStatus type is somewhat GHC-specific.
589[forkOS: start the new thread in blocked mode iff the parent was (#1048)
590Simon Marlow <marlowsd@gmail.com>**20080709135558
591 This matches the behaviour of forkIO
593[Add Control.Exception.blocked :: IO Bool
594Simon Marlow <marlowsd@gmail.com>**20080709133139
595 Tells you whether async exceptions are currently blocked or not.
597[FIX BUILD (on Windows)
598Simon Marlow <marlowsd@gmail.com>**20080709123110]
599[check CONST_SIGINT
600Simon Marlow <marlowsd@gmail.com>**20080709122527]
601[Make threadWaitRead/threadWaitWrite partially useable on Windows
602Simon Marlow <marlowsd@gmail.com>**20080709111008
604 They work with -threaded by calling fdReady() in a separate thread.
606 "threadWaitRead 0" also works without -threaded (because we happen to
607 know it's virtually equivalent to "hWaitForInput stdin (-1)").
609[FIX #1198: hWaitForInput on Windows
610Simon Marlow <marlowsd@gmail.com>**20080708134254
611 Now we do the appropriate magic in fdReady() to detect when there is
612 real input available, as opposed to uninteresting console events.
614[FIX part of #2301
615Simon Marlow <marlowsd@gmail.com>**20080709094437
617 Control-C now causes the new exception (AsyncException UserInterrupt)
618 to be raised in the main thread.  The signal handler is set up by
619 GHC.TopHandler.runMainIO, and can be overriden in the usual way by
620 installing a new signal handler.  The advantage is that now all
621 programs will get a chance to clean up on ^C.
623 When UserInterrupt is caught by the topmost handler, we now exit the
624 program via kill(getpid(),SIGINT), which tells the parent process that
625 we exited as a result of ^C, so the parent can take appropriate action
626 (it might want to exit too, for example).
628 One subtlety is that we have to use a weak reference to the ThreadId
629 for the main thread, so that the signal handler doesn't prevent the
630 main thread from being subject to deadlock detection.
632[() has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple
633Ian Lynagh <igloo@earth.li>**20080624144932]
634[Add GHC.Exts.maxTupleSize :: Int, the size of the largest tuple supported
635Ian Lynagh <igloo@earth.li>**20080622141559]
636[Remove code for older GHC versions
637Ian Lynagh <igloo@earth.li>**20080620194521]
638[Make the macros in Typeable.h add type signatures
639Ian Lynagh <igloo@earth.li>**20080619235808]
640[Fix #2363: getChar cannot be interrupted with -threaded
641Simon Marlow <marlowsd@gmail.com>**20080619141911
642 Now in -threaded mode, instead of just making a blocking call to
643 read(), we call select() first to make sure the read() won't block,
644 and if it would block, then we use threadWaitRead.
646 The idea is that the current thread must be interruptible while it
647 blocks.  This is a little slower than before, but the overhead only
648 applies to blocking Handles (stdin/stdout/stderr, and those created by
649 System.Process).
651[Remove -fglasgow-exts from pragmas and comments
652Ian Lynagh <igloo@earth.li>**20080616230727]
653[Avoid using deprecated flags
654Ian Lynagh <igloo@earth.li>**20080616145207]
655[delete __hscore_{mkstemp,getrlimit,setrlimit} (moved to unix)
656Ross Paterson <ross@soi.city.ac.uk>**20080615224413]
657[Update WCsubst.c for Unicode 5.1.0, and add a README.Unicode
658Ian Lynagh <igloo@earth.li>**20080613201754
659 README.Unicode describes how to do updates in the future.
661[Fix ubconfc
662Ian Lynagh <igloo@earth.li>**20080613201456
663 The current code doesn't seem to be what was used to generate WCsubst.c,
664 so I'm not sure if it never worked, or if my tools work slightly
665 differently to those of the previous user.
667['permutations' is now more lazy and also faster
668Twan van Laarhoven <twanvl@gmail.com>**20080102231712]
669['subsequences' is now more lazy and also faster
670Twan van Laarhoven <twanvl@gmail.com>**20080102231629]
671[Add 'subsequences' and 'permutations' to Data.List
672Twan van Laarhoven <twanvl@gmail.com>**20071218154950]
673[Tweak the definition of (^) again
674Ian Lynagh <igloo@earth.li>**20080601120759
675 This fixes trac #2306 (do the minimum number of (*)s), and also means
676 that we don't use the value of (1 :: a) which causes problems if the
677 Num a definition isn't complete.
679[note about evaluation affecting StableNames
680Simon Marlow <marlowsd@gmail.com>**20080527110549]
681[TAG 2008-05-28
682Ian Lynagh <igloo@earth.li>**20080528003830]
683Patch bundle hash: