Changeset 13007
- Timestamp:
- Oct 12, 2009, 9:00:54 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/lib/misc.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lib/misc.lisp
r12936 r13007 1052 1052 (%ptr-to-int (%svref lock target::lock._value-cell))))) 1053 1053 1054 (defun all-watched-objects () 1055 (let (result) 1056 (with-other-threads-suspended 1057 (%map-areas #'(lambda (x) (push x result)) area-watched area-watched)) 1058 result)) 1059 1054 1060 (defun watch (&optional thing) 1055 1061 (if thing … … 1057 1063 (require-type thing '(or cons (satisfies uvectorp))) 1058 1064 (%watch thing)) 1059 (let (result) 1060 (%map-areas #'(lambda (x) (push x result)) area-watched area-watched) 1061 result))) 1065 (all-watched-objects))) 1062 1066 1063 1067 (defun unwatch (thing) 1064 (%map-areas #'(lambda (x) 1065 (when (eq x thing) 1066 ;; This is a rather questionable thing to do, 1067 ;; since we'll be unlinking an area from the area 1068 ;; list while %map-areas iterates over it, but I 1069 ;; think we'll get away with it. 1070 (let ((new (if (uvectorp thing) 1071 (%alloc-misc (uvsize thing) (typecode thing)) 1072 (cons nil nil)))) 1073 (return-from unwatch (%unwatch thing new))))) 1074 area-watched area-watched)) 1068 (with-other-threads-suspended 1069 (%map-areas #'(lambda (x) 1070 (when (eq x thing) 1071 (let ((new (if (uvectorp thing) 1072 (%alloc-misc (uvsize thing) 1073 (typecode thing)) 1074 (cons nil nil)))) 1075 (return-from unwatch (%unwatch thing new))))) 1076 area-watched area-watched))) 1075 1077
Note:
See TracChangeset
for help on using the changeset viewer.
