Commits

Jean-Marie Gaillourdet committed ada685a

force evaluation of lock before we take it

Comments (0)

Files changed (1)

src/Data/Global/Registry.hs

 -- Ugly workaround to http://hackage.haskell.org/trac/ghc/ticket/5540
 typeOf' :: Typeable a => a -> IO TypeRep
 typeOf' x =
- do { () <- takeMVar lock
+ do { lock' <- evaluate lock
+    ; () <- takeMVar lock'
     ; t <- evaluate $ typeOf x
-    ; putMVar lock ()
+    ; putMVar lock' ()
     ; return t
     }