Copy with-lock from scsh into sunet-utilities.
This commit is contained in:
parent
7fc87572bb
commit
c43a8b8f35
|
@ -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))))
|
||||||
|
|
|
@ -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)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue