Ticket #8235: 0001-EventManager-Gracefully-handle-an-initial-Finished-s.patch

File 0001-EventManager-Gracefully-handle-an-initial-Finished-s.patch, 1.1 KB (added by parcs, 8 months ago)
  • GHC/Event/Manager.hs

    From f8fe34ed5ecf9b10c7e895d420fc509ac3554799 Mon Sep 17 00:00:00 2001
    From: Patrick Palka <patrick@parcs.ath.cx>
    Date: Sun, 8 Sep 2013 12:22:01 -0400
    Subject: [PATCH] EventManager: Gracefully handle an initial 'Finished' state
     (#8235)
    
    ---
     GHC/Event/Manager.hs | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/GHC/Event/Manager.hs b/GHC/Event/Manager.hs
    index 8c8858b..5c87d0c 100644
    a b loop mgr@EventManager{..} = do 
    248248    Created   -> go `onException` cleanup mgr 
    249249    Releasing -> go `onException` cleanup mgr 
    250250    Dying     -> cleanup mgr 
     251    -- While a poll loop is never forked when the event manager is in the 
     252    -- 'Finished' state, its state could read 'Finished' once the new thread 
     253    -- actually runs.  This is not an error, just an unfortunate race condition 
     254    -- in Thread.restartPollLoop.  See #8235 
     255    Finished  -> return () 
    251256    _         -> do cleanup mgr 
    252257                    error $ "GHC.Event.Manager.loop: state is already " ++ 
    253258                            show state