Changeset 12240 for trunk/source/level-1


Ignore:
Timestamp:
Jun 10, 2009, 8:41:20 AM (10 years ago)
Author:
gb
Message:

(experimentally) change the semantics of streams' :sharing :private
option: stream is "owned" by the first thread to do I/O on it, not
necessarily the creating thread.

INFER-LINE-TERMINATION on file streams: if the creating thread does
I/O (to infer line termination), renounce ownership after doing so.

Location:
trunk/source/level-1
Files:
2 edited

Legend:

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

    r12217 r12240  
    483483    (if owner
    484484      (or (eq owner *current-process*)
     485          (conditional-store (ioblock-owner ioblock) 0 *current-process*)
    485486          (error "Stream ~s is private to ~s" (ioblock-stream ioblock) owner)))))
    486487
     
    31073108                      (stream-create-ioblock stream))))
    31083109    (when (eq sharing :private)
    3109       (setf (ioblock-owner ioblock) *current-process*))
     3110      (setf (ioblock-owner ioblock) 0))
    31103111    (setf (ioblock-encoding ioblock) encoding)
    31113112    (when insize
     
    47704771(defmethod stream-owner ((stream buffered-stream-mixin))
    47714772  (let* ((ioblock (stream-ioblock stream nil)))
    4772     (and ioblock (ioblock-owner ioblock))))
     4773    (and ioblock (let* ((owner (ioblock-owner ioblock)))
     4774                   (unless (eql owner 0) owner)))))
    47734775
    47744776(defmethod stream-owner ((stream basic-stream))
    47754777  (let* ((ioblock (basic-stream.state stream)))
    4776     (and ioblock (ioblock-owner ioblock))))
     4778    (and ioblock (let* ((owner (ioblock-owner ioblock)))
     4779                   (unless (eql owner 0) owner)))))
    47774780
    47784781
  • trunk/source/level-1/l1-sysio.lisp

    r11628 r12240  
    7676            (install-ioblock-input-line-termination file-ioblock line-termination)
    7777            (when (file-ioblock-outbuf file-ioblock)
    78               (install-ioblock-output-line-termination file-ioblock line-termination))))))))
     78              (install-ioblock-output-line-termination file-ioblock line-termination))))))
     79    (when (eq (ioblock-owner file-ioblock) *current-process*)
     80      (setf (ioblock-owner file-ioblock) 0))))
    7981
    8082
Note: See TracChangeset for help on using the changeset viewer.