Changeset 14538 for release


Ignore:
Timestamp:
Dec 31, 2010, 4:23:17 PM (8 years ago)
Author:
wws
Message:

Merge 14519 from trunk

Location:
release/1.6/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/1.6/source

  • release/1.6/source/lib/macros.lisp

    r14381 r14538  
    32183218
    32193219
    3220 
    3221 
    3222 
    32233220(defmacro with-read-lock ((lock) &body body)
    32243221  "Wait until a given lock is available for read-only access, then evaluate
    32253222its body with the lock held."
    3226   (let* ((p (gensym)))
     3223  (let* ((locked (gensym))
     3224         (p (gensym)))
    32273225    `(with-lock-context
    3228       (let* ((,p ,lock))
    3229         (unwind-protect
    3230              (progn
    3231                (read-lock-rwlock ,p)
    3232                ,@body)
    3233           (unlock-rwlock ,p))))))
    3234 
     3226       (let* ((,locked (make-lock-acquisition))
     3227              (,p ,lock))
     3228         (declare (dynamic-extent ,locked))
     3229         (unwind-protect
     3230              (progn
     3231                (read-lock-rwlock ,p ,locked)
     3232                ,@body)
     3233           (when (lock-acquisition.status ,locked) (unlock-rwlock ,p)))))))
    32353234
    32363235(defmacro with-write-lock ((lock) &body body)
    32373236  "Wait until the given lock is available for write access, then execute
    32383237its body with the lock held."
    3239   (let* ((p (gensym)))
     3238  (let* ((locked (gensym))
     3239         (p (gensym)))
    32403240    `(with-lock-context
    3241       (let* ((,p ,lock))
    3242       (unwind-protect
    3243            (progn
    3244              (write-lock-rwlock ,p)
    3245              ,@body)
    3246         (unlock-rwlock ,p))))))
    3247 
    3248 
     3241       (let* ((,locked (make-lock-acquisition))
     3242              (,p ,lock))
     3243         (declare (dynamic-extent ,locked))
     3244         (unwind-protect
     3245              (progn
     3246                (write-lock-rwlock ,p ,locked)
     3247                ,@body)
     3248           (when (lock-acquisition.status ,locked) (unlock-rwlock ,p)))))))
    32493249
    32503250(defmacro without-gcing (&body body)
Note: See TracChangeset for help on using the changeset viewer.