Skip to content
  • Simon Marlow's avatar
    [project @ 2002-09-25 14:46:31 by simonmar] · 28e69a6b
    Simon Marlow authored
    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.
    28e69a6b