#547 Nested 'atomically' should raise an exception

open
nobody
5
2005-12-05
2005-12-05
No

Using 'atomically' inside an unsafePerformIO, inside
another 'atomically' should raise an exception.
Currently, it seg-faults.

Here's an example:

import Control.Concurrent.STM
import System.IO.Unsafe (unsafePerformIO)

{-# NOINLINE var #-}
var :: TVar ()
var = unsafePerformIO (atomically (newTVar ()))

main = atomically (readTVar var)

Simon

Discussion