add-break-thread!

clojure.contrib.repl-utils

  • (add-break-thread!)
  • (add-break-thread! t)
Add the given thread to break-threads so that it will be stopped
any time the user presses Ctrl-C. Calls start-handling-break for
you. Adds the current thread if none is given.

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:168 top

(defn add-break-thread!
  "Add the given thread to break-threads so that it will be stopped
  any time the user presses Ctrl-C.  Calls start-handling-break for
  you.  Adds the current thread if none is given."
  ([] (add-break-thread! (Thread/currentThread)))
  ([t]
    (start-handling-break)
    (let [tref (java.lang.ref.WeakReference. t)]
      (swap! break-threads assoc (.getId t) tref))))
Vars in clojure.contrib.repl-utils/add-break-thread!: break-threads start-handling-break assoc defn let swap!
Used in 0 other vars

Comments top

No comments for add-break-thread!. Log in to add a comment.