diff --git a/mstate.cabal b/mstate.cabal
--- a/mstate.cabal
+++ b/mstate.cabal
@@ -8,7 +8,7 @@
 Author:         Nils Schweinsberg
 Maintainer:     <mail@n-sch.de>
 
-Version:        0.1.2
+Version:        0.1.3
 Category:       Concurrent, Monads
 License:        BSD3
 License-File:   LICENSE
diff --git a/src/Control/Concurrent/MState.hs b/src/Control/Concurrent/MState.hs
--- a/src/Control/Concurrent/MState.hs
+++ b/src/Control/Concurrent/MState.hs
@@ -23,6 +23,7 @@
     , execMState
     , mapMState
     , withMState
+    , modifyM
 
       -- * Concurrency
     , Forkable (..)
@@ -40,7 +41,6 @@
 import Control.Monad.Writer
 
 import Control.Concurrent
-import Data.IORef
 
 import qualified Control.Exception as E
 
@@ -48,7 +48,7 @@
 -- | The MState is an abstract data definition for a State monad which can be
 -- used in concurrent applications. It can be accessed with @evalMState@ and
 -- @execMState@. To start a new state thread use @forkM@.
-newtype MState t m a = MState { runMState' :: (IORef t, Chan (MVar ())) -> m a }
+newtype MState t m a = MState { runMState' :: (MVar t, Chan (MVar ())) -> m a }
 
 
 -- | The class which is needed to start new threads in the MState monad. Don't
@@ -90,7 +90,7 @@
            -> m (a,t)
 runMState m t = do
 
-    ref <- liftIO $ newIORef t
+    ref <- liftIO $ newMVar t
     c   <- liftIO newChan
     mv  <- liftIO newEmptyMVar
 
@@ -98,7 +98,7 @@
 
     waitForTermination c
     a  <- liftIO $ takeMVar mv
-    t' <- liftIO $ readIORef ref
+    t' <- liftIO $ readMVar ref
     return (a,t')
 
 
@@ -129,9 +129,9 @@
 mapMState f m = MState $ \s@(r,_) -> do
     ~(b,v') <- f $ do
         a <- runMState' m s
-        v <- liftIO $ readIORef r
+        v <- liftIO $ readMVar r
         return (a,v)
-    liftIO $ writeIORef r v'
+    _ <- liftIO $ swapMVar r v'
     return b
 
 
@@ -141,7 +141,7 @@
            -> MState t m a
            -> MState t m a
 withMState f m = MState $ \s@(r,_) -> do
-    liftIO $ modifyIORef r f
+    liftIO $ modifyMVar_ r (return . f)
     runMState' m s
 
 
@@ -158,6 +158,11 @@
     fork $ runMState' m s >> liftIO (putMVar w ())
 
 
+-- | Modify the MState. Block all other threads from accessing the state.
+modifyM :: (MonadIO m) => (t -> t) -> MState t m ()
+modifyM f = MState $ \(t,_) -> liftIO $ modifyMVar_ t (return . f)
+
+
 --------------------------------------------------------------------------------
 -- Monad instances
 --------------------------------------------------------------------------------
@@ -179,8 +184,9 @@
     m `mplus` n = MState $ \t -> runMState' m t `mplus` runMState' n t
 
 instance (MonadIO m) => MonadState t (MState t m) where
-    get     = MState $ \(r,_) -> liftIO $ readIORef r
-    put val = MState $ \(r,_) -> liftIO $ writeIORef r val
+    get     = MState $ \(r,_) -> liftIO $ readMVar r
+    put val = MState $ \(r,_) -> do _ <- liftIO $ swapMVar r val
+                                    return ()
 
 instance (MonadFix m) => MonadFix (MState t m) where
     mfix f = MState $ \s -> mfix $ \a -> runMState' (f a) s
