#7787: modifyMVar does not restore value if callback returns error value ---------------------------------+------------------------------------------ Reporter: joeyadams | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: libraries/base | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Incorrect result at runtime Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by parcs): Replying to [comment:1 ezyang]:
Another possibility is to replace the pattern match with an irrefutable pattern. I'm not sure which is better, though an irrefutable pattern could make laziness bugs worse.
Btw this is what `atomicModifyIORef` essentially does. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7787#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler