Socket streams are now two-way streams.
authorJuan Jose Garcia Ripoll <jjgarcia@jjgr-2.local>
Fri, 12 Feb 2010 17:33:04 +0000 (18:33 +0100)
committerJuan Jose Garcia Ripoll <jjgarcia@jjgr-2.local>
Fri, 12 Feb 2010 17:33:04 +0000 (18:33 +0100)
contrib/sockets/sockets.lisp
src/CHANGELOG

index e7c4f1e..b9906e3 100755 (executable)
@@ -1177,9 +1177,19 @@ also known as unix-domain sockets."))
   (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))
index c67e01a..057302e 100755 (executable)
@@ -43,6 +43,10 @@ ECL 10.2.1:
    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