[project @ 2002-09-25 14:46:31 by simonmar]
authorsimonmar <unknown>
Wed, 25 Sep 2002 14:46:34 +0000 (14:46 +0000)
committersimonmar <unknown>
Wed, 25 Sep 2002 14:46:34 +0000 (14:46 +0000)
commit28e69a6b23d437997d8963dd14a3fc9a5f292700
treec833e5da0240c65b9d793d8022374e403af74dea
parent46732ee640c33bb2af8085d4785f511e9d89a95b
[project @ 2002-09-25 14:46:31 by simonmar]
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.
ghc/rts/GC.c
ghc/rts/Schedule.c