Changeset 7809


Ignore:
Timestamp:
Dec 3, 2007, 11:30:34 AM (13 years ago)
Author:
gb
Message:

Use WITHOUT-INTERRUPTS in FD-STREAM-FORCE-OUTPUT.

File:
1 edited

Legend:

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

    r7635 r7809  
    53705370(defun fd-stream-force-output (s ioblock count finish-p)
    53715371  (when (or (ioblock-dirty ioblock) finish-p)
    5372     (setf (ioblock-dirty ioblock) nil)
    53735372    (let* ((fd (ioblock-device ioblock))
    53745373           (io-buffer (ioblock-outbuf ioblock))
     
    53785377      (declare (fixnum octets))
    53795378      (declare (dynamic-extent buf))
    5380       (%setf-macptr buf (io-buffer-bufptr io-buffer))
    5381       (setf (io-buffer-idx io-buffer) 0
    5382             (io-buffer-count io-buffer) 0)
    5383       (do* ()
    5384            ((= octets 0)
    5385             (when finish-p
    5386               (case (%unix-fd-kind fd)
    5387                 (:file (fd-fsync fd))))
    5388             octets-to-write)
    5389         (let* ((written (with-eagain fd :output
    5390                           (fd-write fd buf octets))))
    5391           (declare (fixnum written))
    5392           (if (< written 0)
    5393             (stream-io-error s (- written) "write"))
    5394           (decf octets written)
    5395           (unless (zerop octets)
    5396             (%incf-ptr buf written)))))))
     5379      (without-interrupts
     5380       (setf (ioblock-dirty ioblock) nil)
     5381       (%setf-macptr buf (io-buffer-bufptr io-buffer))
     5382       (setf (io-buffer-idx io-buffer) 0
     5383             (io-buffer-count io-buffer) 0)
     5384       (do* ()
     5385            ((= octets 0)
     5386             (when finish-p
     5387               (case (%unix-fd-kind fd)
     5388                 (:file (fd-fsync fd))))
     5389             octets-to-write)
     5390         (let* ((written (with-eagain fd :output
     5391                                      (fd-write fd buf octets))))
     5392           (declare (fixnum written))
     5393           (if (< written 0)
     5394             (stream-io-error s (- written) "write"))
     5395           (decf octets written)
     5396           (unless (zerop octets)
     5397             (%incf-ptr buf written))))))))
    53975398
    53985399(defmethod stream-read-line ((s buffered-input-stream-mixin))
Note: See TracChangeset for help on using the changeset viewer.