X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-defstruct.lisp;h=ef0761face226e618efccabb8f2e124a4e80eced;hb=cf0b72cd4052a09b9a305081524bd44e2948c1e5;hp=d41ff7a2a29a165e06a9712bfb286f87dac83eae;hpb=085501b44cc1cbdd9e260139d30b383372ddd1b8;p=sbcl.git diff --git a/src/code/target-defstruct.lisp b/src/code/target-defstruct.lisp index d41ff7a..ef0761f 100644 --- a/src/code/target-defstruct.lisp +++ b/src/code/target-defstruct.lisp @@ -31,6 +31,15 @@ (defun %instance-set (instance index new-value) (setf (%instance-ref instance index) new-value)) +(defun %instance-compare-and-swap (instance index old new) + #!+(or x86 x86-64) + (%instance-compare-and-swap instance index old new) + #!-(or x86 x86-64) + (let ((n-old (%instance-ref instance index))) + (when (eq old n-old) + (%instance-set instance index new)) + n-old)) + #!-hppa (progn (defun %raw-instance-ref/word (instance index)