Changeset 5390


Ignore:
Timestamp:
Oct 21, 2006, 5:40:36 PM (18 years ago)
Author:
Gary Byers
Message:

Mostly locking changes (don't lock twice, etc.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-streams.lisp

    r5360 r5390  
    477477  (declare (optimize (speed 3) (safety 0)))
    478478  (if (ioblock-untyi-char ioblock)
    479     (prog1 (%char-code (ioblock-untyi-char ioblock))
    480       (setf (ioblock-untyi-char ioblock) nil))
    481     (let* ((buf (ioblock-inbuf ioblock))
    482            (idx (io-buffer-idx buf))
    483            (limit (io-buffer-count buf)))
    484       (declare (fixnum idx limit))
    485       (when (= idx limit)
    486         (unless (%ioblock-advance ioblock t)
    487           (return-from %bivalent-ioblock-read-u8-byte :eof))
    488         (setq idx (io-buffer-idx buf)
    489               limit (io-buffer-count buf)))
    490       (setf (io-buffer-idx buf) (the fixnum (1+ idx)))
    491       (aref (the (simple-array (unsigned-byte 8) (*))
    492               (io-buffer-buffer buf)) idx))))
     479    (setf (ioblock-untyi-char ioblock) nil))
     480  (let* ((buf (ioblock-inbuf ioblock))
     481         (idx (io-buffer-idx buf))
     482         (limit (io-buffer-count buf)))
     483    (declare (fixnum idx limit))
     484    (when (= idx limit)
     485      (unless (%ioblock-advance ioblock t)
     486        (return-from %bivalent-ioblock-read-u8-byte :eof))
     487      (setq idx (io-buffer-idx buf)
     488            limit (io-buffer-count buf)))
     489    (setf (io-buffer-idx buf) (the fixnum (1+ idx)))
     490    (aref (the (simple-array (unsigned-byte 8) (*))
     491              (io-buffer-buffer buf)) idx)))
    493492
    494493
     
    11691168(defun %locked-ioblock-read-u8-encoded-char (ioblock)
    11701169  (declare (optimize (speed 3) (safety 0)))
    1171   (with-ioblock-input-locked (ioblock)
     1170m  (with-ioblock-input-lock-grabbed (ioblock)
    11721171    (%ioblock-read-u8-encoded-char ioblock)))
    11731172
     
    37033702    (let* ((ioblock (basic-stream-ioblock stream)))
    37043703      (with-ioblock-input-locked (ioblock)
    3705       (locally (declare (optimize (speed 3)))
    3706         (without-interrupts
    3707          (values
    3708           (funcall (ioblock-character-read-vector-function ioblock)
    3709                    ioblock vector start end))))))))
     3704        (locally (declare (optimize (speed 3)))
     3705          (without-interrupts
     3706           (values
     3707            (funcall (ioblock-character-read-vector-function ioblock)
     3708                     ioblock vector start end))))))))
    37103709
    37113710(defmethod stream-read-line ((stream basic-character-input-stream))
     
    45244523
    45254524(defmethod stream-read-byte ((stream buffered-binary-input-stream-mixin))
    4526   (with-stream-ioblock-input (ioblock stream :speedy t)
     4525  (let* ((ioblock (stream-ioblock stream t)))
    45274526    (locally (declare (optimize (speed 3)))
    45284527      (without-interrupts
     
    45324531(defmethod stream-read-byte ((stream basic-binary-input-stream))
    45334532  (let* ((ioblock (basic-stream-ioblock stream)))
    4534     (with-ioblock-input-locked (ioblock)
    4535       (locally (declare (optimize (speed 3)))
    4536         (without-interrupts
    4537          (values
    4538           (funcall (ioblock-read-byte-function ioblock) ioblock)))))))
     4533    (locally (declare (optimize (speed 3)))
     4534      (without-interrupts
     4535       (values
     4536        (funcall (ioblock-read-byte-function ioblock) ioblock))))))
    45394537
    45404538(defmethod stream-eofp ((stream buffered-input-stream-mixin))
Note: See TracChangeset for help on using the changeset viewer.