cvs commit: fptools/ghc/rts Schedule.c GC.c

Simon Marlow simonmar@glass.cse.ogi.edu
Wed, 25 Sep 2002 07:46:38 -0700


simonmar    2002/09/25 07:46:38 PDT

  Modified files:
    ghc/rts              Schedule.c GC.c 
  Log:
  Fix a scheduling/GC bug, spotted by Wolfgang Thaller.  If a main
  thread completes, and a GC runs before the return (from rts_evalIO())
  happens, then the thread might be GC'd before we get a chance to
  extract its return value, leading to barf("main thread has been GC'd")
  from the garbage collector.
  
  The fix is to treat all main threads which have completed as roots:
  this is logically the right thing to do, because these threads must be
  retained by virtue of holding the return value, and this is a property of
  main threads only.
  
  Revision  Changes    Path
  1.156     +20 -1     fptools/ghc/rts/Schedule.c
  1.144     +10 -7     fptools/ghc/rts/GC.c
_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc