From: Bas van Dijk Date: Fri, 19 Mar 2010 12:59:51 +0000 (+0000) Subject: Write the thunk 'next' to the MVar X-Git-Url: http://git.megacz.com/?p=ghc-base.git;a=commitdiff_plain;h=4efca33ed97059439d1651743e08248b35aba02b Write the thunk 'next' to the MVar --- diff --git a/Data/Unique.hs b/Data/Unique.hs index 38c8e48..55dfa50 100644 --- a/Data/Unique.hs +++ b/Data/Unique.hs @@ -45,7 +45,7 @@ newUnique :: IO Unique newUnique = atomically $ do val <- readTVar uniqSource let next = val+1 - writeTVar uniqSource $! val + 1 + writeTVar uniqSource $! next return (Unique next) -- SDM (18/3/2010): changed from MVar to STM. This fixes