11 lines
157 B
Scheme
11 lines
157 B
Scheme
|
;; From sunterlib
|
||
|
|
||
|
(define (with-lock lock thunk)
|
||
|
(dynamic-wind
|
||
|
(lambda ()
|
||
|
(obtain-lock lock))
|
||
|
thunk
|
||
|
(lambda ()
|
||
|
(release-lock lock))))
|
||
|
|