+
+(sb!xc:defmacro with-spinlock ((spinlock) &body body)
+ #!-sb-thread
+ (declare (ignore spinlock))
+ #!-sb-thread
+ `(locally ,@body)
+ #!+sb-thread
+ (with-unique-names (lock got-it)
+ `(let ((,lock ,spinlock)
+ (,got-it nil))
+ (unwind-protect
+ (progn
+ (setf ,got-it (get-spinlock ,lock))
+ (locally ,@body))
+ (when ,got-it
+ (release-spinlock ,lock))))))