locked :: Scheduler -> IO a -> IO a
locked scheduler action = modifyMVar (lock scheduler) $ \() -> do
  v <- action
  return $! ((), v)
locked :: Scheduler -> IO a -> IO a
locked scheduler action = modifyMVar (lock scheduler) $ \() -> do
  v <- action
  return $! ((), v)
locked scheduler action = modifyMVar (lock scheduler) $ \() -> do
  v <- action
  return $! ((), v)