added with()

master
Avril 6 years ago
parent 41285e8759
commit dad706a5bf
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -60,7 +60,15 @@
(<- () (<-! ,name)))
,@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 ()

Loading…
Cancel
Save