This commit is contained in:
Ingy döt Net 2013-06-05 21:47:54 +00:00
parent 1f1ad49427
commit 6f050a029e
2496 changed files with 37609 additions and 3031 deletions

View file

@ -0,0 +1,3 @@
#lang racket
(run-stuff)
(when (something-bad-happened) (exit 1))

View file

@ -0,0 +1,8 @@
#lang racket
(parameterize ([current-custodian (make-custodian)])
(define (loop) (printf "looping\n") (sleep 1) (loop))
(thread loop) ; start a thread under the new custodian
(sleep 5)
;; kill it: this will kill the thread, and any other opened resources
;; like file ports, network connections, etc
(custodian-shutdown-all (current-custodian)))