2003-01-28 07:48:57 -05:00
|
|
|
;;; This file is part of the Scheme Untergrund Library.
|
|
|
|
|
|
|
|
;;; Copyright (c) 2002-2003 by Martin Gasbichler.
|
|
|
|
;;; For copyright information, see the file COPYING which comes with
|
|
|
|
;;; the distribution.
|
|
|
|
|
|
|
|
(define (with-lock lock thunk)
|
|
|
|
(dynamic-wind
|
|
|
|
(lambda ()
|
2003-03-05 09:32:06 -05:00
|
|
|
(obtain-lock lock))
|
2003-01-28 07:48:57 -05:00
|
|
|
thunk
|
|
|
|
(lambda ()
|
|
|
|
(release-lock lock))))
|