   (let [buf (fifo-buffer ago-world (:seqv @ago-world) buf-id 1)
         ch (ago-chan-buf ago-world buf)
         new-sma (acopy old-sma ((aget old-sma ioc-helpers/FN-IDX))
-                       ioc-helpers/STATE-IDX) ; We depend on *-IDX ordering.
-        new-sma2 (ioc-macros/aset-all! new-sma ioc-helpers/USER-START-IDX ch)]
-    (ago-reg-state-machine ago-world new-sma2 buf-id)
-    (dispatch/run
-     (fn []
-       (ago-run-state-machine ago-world new-sma2 buf-id)
-       (ioc-helpers/run-state-machine-wrapped new-sma2)))
+                       ioc-helpers/STATE-IDX)] ; We depend on *-IDX ordering.
+    (ioc-macros/aset-all! new-sma ioc-helpers/USER-START-IDX ch)
+    (ago-run-state-machine ago-world new-sma buf-id)
     ch))
 
 (defn ago-judge-state-machines [bufs-ss smas-ss smas-cur]

    (commit [_] (when (active-cb) f))))

(defn ssa-take [state blk ^not-native c]
  (let [active? #(seqv-alive? (chan-ago-world c) (chan-seqv c))]
    (if-let [cb (protocols/take!
                 c (fn-handler
                    active?
                    (fn [x]
                      (when (active?)
                        (ioc-macros/aset-all! state ioc-helpers/VALUE-IDX
                                              x ioc-helpers/STATE-IDX blk)
                        (ioc-helpers/run-state-machine-wrapped state)))))]
      (do (ioc-macros/aset-all! state ioc-helpers/VALUE-IDX
                                @cb ioc-helpers/STATE-IDX blk)
          :recur)
      nil)))

(defn ssa-put [state blk ^not-native c val]
  (let [active? #(seqv-alive? (chan-ago-world c) (chan-seqv c))]
    (if-let [cb (protocols/put!
                 c val (fn-handler
                        active?
                        (fn [ret-val]
                          (when (active?)
                            (ioc-macros/aset-all! state ioc-helpers/VALUE-IDX
                                                  ret-val ioc-helpers/STATE-IDX blk)
                            (ioc-helpers/run-state-machine-wrapped state)))))]
      (do (ioc-macros/aset-all! state ioc-helpers/VALUE-IDX
                                @cb ioc-helpers/STATE-IDX blk)
          :recur)

      (when-not (nil? value)
        (protocols/put! c value (fn-handler active? (fn [] nil))))
      (protocols/close! c))
    (ago-dereg-state-machine ago-world (chan-buf-id c))
    c))

; --------------------------------------------------------
