<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">In the event manager's registerFd_, we find:<div><br></div><div><div>    registerFd_ :: EventManager -> IOCallback -> Fd -> Event -> Lifetime</div><div>                -> IO (FdKey, Bool)</div><div>    registerFd_ mgr@(EventManager{..}) cb !fd !evs lt = do</div><div>      ... <- ...</div><div><div>      (modify,ok) <- withMVar (callbackTableVar mgr fd) $ \tbl -> do</div></div><div>        ... <- ...</div><div><div>      -- this simulates behavior of old IO manager:</div><div>      -- i.e. just call the callback if the registration fails.</div><div>      when (not ok) (cb reg evs)</div><div>      return (reg,modify)</div></div><div><br></div><div>A comment and a question. Comment: registerFd_ is only ever called in contexts where exceptions are masked, so withMVar is doing some needless mask/restore. Question: why do we immidiately call the callback if event registration fails? This means that if event registration fails during something like `threadWaitRead`, the end result would be that `threadWaitRead` would just return immidiately. That doesn't seem good.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">-Andrew Thaddeus Martin</div></div></div></div></div></div></div>