1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
(in-package #:containers)
(defclass* thread-safe-container-mixin ()
()
(:export-p t))
(defmethod insert-item :around ((container thread-safe-container-mixin) item)
(declare (ignore item))
(u:with-write-access (:container)
(call-next-method)))
(defmethod delete-first :around ((container thread-safe-container-mixin))
(u:with-write-access (:container)
(call-next-method)))
(defmethod iterate-nodes :around ((container thread-safe-container-mixin) fn)
(declare (ignore fn))
(u:with-read-access (:container)
(call-next-method)))
(defmethod empty! :around ((container thread-safe-container-mixin))
(u:with-write-access (:container)
(call-next-method)))
(defmethod first-item :around ((container thread-safe-container-mixin))
(u:with-read-access (:container)
(call-next-method)))
(defmethod size :around ((container thread-safe-container-mixin))
(u:with-read-access (:container)
(call-next-method)))
|