Thread-safe slot accessors in CLOS
I've found myself doing the following periodically: (defclass foo () ((bar :initarg :bar :initform nil :reader foo-bar))) (defmethod (setf foo-bar) (new-value (foo foo)) (sys:atomic-exchange (slot-value foo 'bar) new-value)) I do this because bar is being used in another thread (obviously), and I want it to be safely setf-able. I'm just wondering if there's a nice LW-y way to do this from within the class definition? For example: (defclass foo () ((bar :initarg :bar :initform nil :accessor foo-bar :safety :atomic))) Has an option like this ever been considered for LW? Or perhaps making an option so the :writer is automatically wrapped in some manner? Jeff M. _______________________________________________ Lisp Hug - the mailing list for LispWorks users lisp-hug@lispworks.com http://www.lispworks.com/support/lisp-hug.html