sunterlib/s48/concurrency/with-lock.scm

14 lines
338 B
Scheme
Raw Normal View History

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 ()
(release-lock lock))
thunk
(lambda ()
(release-lock lock))))