Changeset 7193


Ignore:
Timestamp:
Sep 11, 2007, 11:16:20 AM (12 years ago)
Author:
gb
Message:

%SYSTEM-LOCKS% initialized earlier.
New rwlock creation/access stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0709/ccl/level-0/l0-aprims.lisp

    r6559 r7193  
    2222;;; This weak list is used to track semaphores as well as locks.
    2323(defvar %system-locks% nil)
    24 (setf %system-locks% (%cons-population nil))
     24
    2525
    2626(defun record-system-lock (l)
     
    123123             :address))))
    124124
    125 
     125(defun %make-rwlock-ptr ()
     126  (record-system-lock
     127   (%setf-macptr
     128    (make-gcable-macptr $flags_DisposeRwLock)
     129    (ff-call (%kernel-import target::kernel-import-rwlock-new)
     130             :address))))
    126131 
    127132(defun make-recursive-lock ()
     
    142147    (report-bad-arg r 'recursive-lock)))
    143148
    144 
     149(defun read-write-lock-ptr (rw)
     150  (if (and (eq target::subtag-lock (typecode rw))
     151           (eq (%svref rw target::lock.kind-cell) 'read-write-lock))
     152    (%svref rw target::lock._value-cell)
     153    (report-bad-arg rw 'read-write-lock)))
    145154
    146155(defun make-read-write-lock ()
    147156  "Create and return a read-write lock, which can be used for
    148157synchronization between threads."
    149   (gvector :lock 0 'read-write-lock 0 nil))
     158  (gvector :lock (%make-rwlock-ptr) 'read-write-lock 0 nil))
    150159
    151160
Note: See TracChangeset for help on using the changeset viewer.