|
|
|
@ -61,6 +61,14 @@
|
|
|
|
|
,@things)
|
|
|
|
|
(<-! ,name)))))
|
|
|
|
|
|
|
|
|
|
(defmacro with (box &body things)
|
|
|
|
|
(let ((name (gensym)))
|
|
|
|
|
`(let ((,name ,box))
|
|
|
|
|
(bt:with-lock-held ((box-lock ,name))
|
|
|
|
|
(flet ((-> (thing) (->! ,name thing))
|
|
|
|
|
(<- () (<-! ,name)))
|
|
|
|
|
,@things)))))
|
|
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defun test ()
|
|
|
|
|