Changeset 6018


Ignore:
Timestamp:
Mar 9, 2007, 6:59:33 AM (13 years ago)
Author:
gb
Message:

OPEN-FILE-STREAMS is a function, returns a copy of a list of open file streams
in PREPARE-TO-QUIT.

File:
1 edited

Legend:

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

    r5994 r6018  
    151151            (timed-wait-on-semaphore semaphore 0.10)))))
    152152    (shutdown-lisp-threads)
    153     ;; Don't need to grab *open-file-streams-lock* here, since
    154     ;; we're single-threaded at this point.
    155     (while *open-file-streams*
    156       (let* ((ioblock (stream-ioblock (car *open-file-streams*) nil)))
    157         (when ioblock
    158           (setf (ioblock-inbuf-lock ioblock) nil
    159                 (ioblock-outbuf-lock ioblock) nil
    160                 (ioblock-owner ioblock) nil)))
    161       (close (car *open-file-streams*)))
     153    (loop
     154      (let* ((streams (open-file-streams)))
     155        (when (null streams) (return))
     156        (let* ((ioblock (stream-ioblock (car streams) nil)))
     157          (when ioblock
     158            (setf (ioblock-inbuf-lock ioblock) nil
     159                  (ioblock-outbuf-lock ioblock) nil
     160                  (ioblock-owner ioblock) nil)))
     161        (close (car streams))))
    162162    (setf (interrupt-level) -1)         ; can't abort after this
    163163    ))
Note: See TracChangeset for help on using the changeset viewer.