@@ -129,16 +129,16 @@ forkIt current proc = do
129129 -- update the new thread before reclaiming zombies so that if it exited
130130 -- already reclaim finds it in the list and does not panic.
131131 liftIO $ modifyIORef (pendingThreads cur) $ (\ts -> tid:ts)
132− tryReclaimZombies (zombieChannel cur) (pendingThreads cur)
132+ tryReclaimZombies (childChannel cur) (pendingThreads cur)
133133
134134 newChildCont cur = do
135135 pendingRef <- liftIO $ newIORef []
136136 chan <- liftIO $ atomically newTChan
137137 -- shares the threadCredit of the parent by default
138138 return $ cur
139− { parent = Just cur
139+ { parentChannel = Just (childChannel cur)
140140 , pendingThreads = pendingRef
141− , zombieChannel = chan
141+ , childChannel = chan
142142 }
143143
144144 beforeExit cur res = do
@@ -148,13 +148,13 @@ forkIt current proc = do
148148 Right _ -> -- collect the results?
149149 return ()
150150
151− waitForChildren (zombieChannel cur) (pendingThreads cur)
151+ waitForChildren (childChannel cur) (pendingThreads cur)
152152 signalQSemB (threadCredit cur)
153153 -- We are guaranteed to have a parent because we have been explicitly
154154 -- forked by some parent.
155− let p = fromJust (parent cur)
155+ let p = fromJust (parentChannel cur)
156156 tid <- myThreadId
157− liftIO $ atomically $ writeTChan (zombieChannel p) tid
157+ liftIO $ atomically $ writeTChan p tid
158158
159159forkMaybe :: (MonadBaseControl IO m, MonadIO m) => EventF -> (EventF -> m ()) -> m ()
160160forkMaybe current toRun = do
@@ -169,7 +169,7 @@ forkMaybe current toRun = do
169169 -- special handling for those cases. Add those to
170170 -- unreclaimable list? And always execute them in an
171171 -- async thread, cannot use sync for those.
172− waitForOneChild (zombieChannel current)
172+ waitForOneChild (childChannel current)
173173 (pendingThreads current)
174174 forkMaybe current toRun
175175 True -> forkIt current toRun