start-handling-break

clojure.contrib.repl-utils

  • (start-handling-break)
Register INT signal handler. After calling this, Ctrl-C will cause
all break-threads to be stopped. See 'add-break-thread!'

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/repl_utils.clj:153 top

  (defn start-handling-break
    "Register INT signal handler.  After calling this, Ctrl-C will cause
    all break-threads to be stopped.  See 'add-break-thread!'"
    []
    (when (= :need-init
             (swap! first-time
                    {:need-init false, false false, true :need-init}))
      (sun.misc.Signal/handle
        (sun.misc.Signal. "INT")
        (proxy [sun.misc.SignalHandler] []
          (handle [sig]
            (let [exc (Exception. (str sig))]
              (doseq [tref (vals @break-threads) :when (.get tref)]
                (.stop (.get tref) exc))))))))
Vars in clojure.contrib.repl-utils/start-handling-break: = defn doseq let proxy swap! when
Used in 1 other vars add-break-thread!

Comments top

No comments for start-handling-break. Log in to add a comment.