Changeset 5049


Ignore:
Timestamp:
Aug 28, 2006, 3:56:28 AM (18 years ago)
Author:
Gary Byers
Message:

Unscramble auto-flush-streams stuff (don't assume ioblock-based stream.)

File:
1 edited

Legend:

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

    r5027 r5049  
    182182  (with-lock-grabbed (*auto-flush-streams-lock*)
    183183    (dolist (s *auto-flush-streams*)
    184       (when (and (open-stream-p s)
    185                  (ioblock-outbuf-lock (stream-ioblock s t)))
    186         (maybe-stream-force-output s)))))
     184      (when (open-stream-p s)
     185        (if (or (typep s 'basic-stream)
     186                (typep s 'buffered-io-stream-mixin))
     187          (if (ioblock-outbuf-lock (stream-ioblock s t))
     188            (maybe-stream-force-output s)))
     189        (force-output s)))))
    187190
    188191(defun add-auto-flush-stream (s)
    189192  (with-lock-grabbed (*auto-flush-streams-lock*)
    190     (unless (member s *auto-flush-streams*)
    191       (let* ((ioblock (stream-ioblock s t)))
    192         (unless (ioblock-outbuf-lock ioblock)
    193           (setf (ioblock-outbuf-lock ioblock) (make-lock)
    194                 (ioblock-owner ioblock) nil)))
    195       (push s *auto-flush-streams*))))
     193    (when (typep s 'output-stream)
     194      (pushnew s *auto-flush-streams*))))
    196195     
    197196(defun remove-auto-flush-stream (s)
Note: See TracChangeset for help on using the changeset viewer.