Changeset 7901


Ignore:
Timestamp:
Dec 12, 2007, 8:25:10 PM (13 years ago)
Author:
gb
Message:

Implement HASH-TABLE-OWNER and CLAIM-HASH-TABLE; the latter probably
isn't ready for prime time yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-0/l0-hash.lisp

    r7897 r7901  
    17181718  (nhash.read-only hash))
    17191719
     1720(defun hash-table-owner (hash)
     1721  (unless (hash-table-p hash)
     1722    (report-bad-arg hash 'hash-table))
     1723  (nhash.owner hash))
     1724
     1725(defun claim-hash-table (hash &optional steal)
     1726  (unless (hash-table-p hash)
     1727    (report-bad-arg hash 'hash-table))
     1728  (let* ((owner (nhash.owner hash)))
     1729    (if owner
     1730      (or (eq owner *current-process*)
     1731          (when steal
     1732            (setf (nhash.owner hash) *current-process*)))
     1733      (progn
     1734        (write-lock-hash-table hash)
     1735        (setf (nhash.exclusion-lock hash) nil
     1736              (nhash.owner hash) *current-process*)
     1737        t))))
     1738
     1739 
     1740 
    17201741(defun enumerate-hash-keys (hash out)
    17211742  (unless (hash-table-p hash)
Note: See TracChangeset for help on using the changeset viewer.