AbstractOperatingSystem.st
changeset 6614 bed21ae9a498
parent 6613 8fd80925d551
child 6618 a5720cd8006e
--- a/AbstractOperatingSystem.st	Wed Jul 10 12:10:11 2002 +0200
+++ b/AbstractOperatingSystem.st	Wed Jul 10 12:20:29 2002 +0200
@@ -1254,16 +1254,17 @@
             outputShufflerProcess notNil ifTrue:[
                 terminateLock critical:[outputShufflerProcess terminate].
                 outputShufflerProcess waitUntilTerminated.
-"/                self shuffleRestFrom:(pOut at:1) to:anOutStream lineWise:lineWise.
+                self shuffleRestFrom:(pOut at:1) to:anOutStream lineWise:lineWise.
                 (pOut at:1) close.
             ].
             errorShufflerProcess notNil ifTrue:[
                 terminateLock critical:[errorShufflerProcess terminate].
                 errorShufflerProcess waitUntilTerminated.
-"/                self shuffleRestFrom:(pErr at:1) to:anOutStream lineWise:lineWise.
+                self shuffleRestFrom:(pErr at:1) to:anErrStream lineWise:lineWise.
                 (pErr at:1) close.
             ].
         ].
+
     pid notNil ifTrue:[
         [
             sema wait.
@@ -1656,66 +1657,6 @@
     self subclassResponsibility
 !
 
-shuffleAllFrom:anInStream to:anOutStream lineWise:lineWise lockWith:aLock
-    [
-        [anInStream atEnd] whileFalse:[
-            anInStream readWait.
-            aLock
-                critical:[
-                    self 
-                        shuffleFrom:anInStream
-                        to:anOutStream
-                        lineWise:lineWise
-                ]
-        ]
-    ] ensure:[
-        self shuffleRestFrom:anInStream to:anOutStream lineWise:lineWise.
-    ]
-!
-
-shuffleFrom:anInStream to:anOutStream lineWise:lineWise 
-    |data nShuffled|
-
-    lineWise ifTrue:[
-        data := anInStream nextLine.
-        nShuffled := data size.
-        nShuffled > 0 ifTrue:[
-            anOutStream nextPutLine:data
-        ]
-    ] ifFalse:[
-        data := anInStream nextAvailable:1024.
-        nShuffled := data size.
-Transcript showCR:nShuffled.
-        nShuffled > 0 ifTrue:[
-            anOutStream nextPutAll:data
-        ]
-    ].
-    ^ nShuffled
-!
-
-shuffleRestFrom:anInStream to:anOutStream lineWise:lineWise 
-    |nShuffled|
-
-    [
-        nShuffled := self 
-                    shuffleFrom:anInStream
-                    to:anOutStream
-                    lineWise:lineWise.
-    ] doUntil:["anInStream atEnd "nShuffled == 0].
-
-    Delay waitForSeconds:5.
-    anInStream clearEOF.
-
-    nShuffled := self 
-                shuffleFrom:anInStream
-                to:anOutStream
-                lineWise:lineWise.
-
-    nShuffled ~~ 0 ifTrue:[
-        self halt
-    ]
-!
-
 startProcess:aCommandString
     "start executing the OS command as specified by the argument, aCommandString
      as a separate process; do not wait for the command to finish.
@@ -3825,6 +3766,49 @@
     "Created: / 12.6.1998 / 16:30:29 / cg"
 ! !
 
+!AbstractOperatingSystem class methodsFor:'private OS execution helpers'!
+
+shuffleAllFrom:anInStream to:anOutStream lineWise:lineWise lockWith:aLock
+    [anInStream atEnd] whileFalse:[
+        anInStream readWait.
+        aLock
+            critical:[
+                self 
+                    shuffleFrom:anInStream
+                    to:anOutStream
+                    lineWise:lineWise
+            ]
+    ]
+!
+
+shuffleFrom:anInStream to:anOutStream lineWise:lineWise 
+    |data nShuffled|
+
+    lineWise ifTrue:[
+        data := anInStream nextLine.
+        nShuffled := data size.
+        nShuffled > 0 ifTrue:[
+            anOutStream nextPutLine:data
+        ]
+    ] ifFalse:[
+        data := anInStream nextAvailable:1024.
+        nShuffled := data size.
+        nShuffled > 0 ifTrue:[
+            anOutStream nextPutAll:data
+        ]
+    ].
+    ^ nShuffled
+!
+
+shuffleRestFrom:anInStream to:anOutStream lineWise:lineWise 
+    [
+        self 
+            shuffleFrom:anInStream
+            to:anOutStream
+            lineWise:lineWise.
+    ] doUntil:[anInStream atEnd].
+! !
+
 !AbstractOperatingSystem class methodsFor:'shared memory access'!
 
 shmAttach:id address:addr flags:flags
@@ -4440,6 +4424,6 @@
 !AbstractOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.69 2002-07-10 10:10:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.70 2002-07-10 10:20:29 cg Exp $'
 ! !
 AbstractOperatingSystem initialize!