(let ((stream (and (slot-boundp socket 'stream)
(slot-value socket 'stream))))
(unless stream
- (setf stream (let ((fd (socket-file-descriptor socket)))
- (make-stream-from-fd fd #-:wsock :input-output #+:wsock :input-output-wsock
- buffering)))
+ (setf stream
+ #+threads
+ (let* ((fd (socket-file-descriptor socket))
+ (in (make-stream-from-fd fd #-wsock :input #+wsock :input-wsock
+ buffering))
+ (out (make-stream-from-fd fd #-wsock :output #+wsock :output-wsock
+ buffering)))
+ (make-two-way-stream in out))
+ #-threads
+ (let ((fd (socket-file-descriptor socket)))
+ (make-stream-from-fd fd #-:wsock :input-output
+ #+:wsock :input-output-wsock
+ buffering)))
(setf (slot-value socket 'stream) stream)
#+ ignore
(sb-ext:cancel-finalization socket))
to recover from it. Now it jumps to the outermost protection frame
(typically the toplevel).
+ - Socket streams are now two-way streams. This solves a problem with
+ multithreaded builds in certain platforms (OS X) where a C stream can not be
+ used to read and write simultaneously.
+
* Visible changes:
- Significant speedup in access to hash tables of up to 30% by writing