Copy with-lock from scsh into sunet-utilities.

This commit is contained in:
mainzelm 2002-12-29 19:09:37 +00:00
parent 7fc87572bb
commit c43a8b8f35
2 changed files with 10 additions and 1 deletions

View File

@ -68,3 +68,10 @@
(define (dump fd) (define (dump fd)
(copy-inport->outport fd (current-output-port))) (copy-inport->outport fd (current-output-port)))
(define (with-lock lock thunk)
(dynamic-wind
(lambda ()
(release-lock lock))
thunk
(lambda ()
(release-lock lock))))

View File

@ -222,7 +222,8 @@
dump dump
system-fqdn system-fqdn
copy-inport->outport copy-inport->outport
dotdot-check)) dotdot-check
with-lock))
(define-interface handle-fatal-error-interface (define-interface handle-fatal-error-interface
(export with-fatal-error-handler* (export with-fatal-error-handler*
@ -617,6 +618,7 @@
srfi-13 srfi-13
dns dns
let-opt ; :optional let-opt ; :optional
locks
handle-fatal-error) handle-fatal-error)
(files (lib sunet-utilities))) (files (lib sunet-utilities)))