DeviceWorkstation.st
changeset 3013 228dca610672
parent 3012 0edbbda887cf
child 3014 8891a63e066b
--- a/DeviceWorkstation.st	Thu Oct 28 20:14:18 1999 +0200
+++ b/DeviceWorkstation.st	Fri Oct 29 11:42:20 1999 +0200
@@ -438,7 +438,7 @@
 
     |badId badResource msg theDevice theSignal p signalHolder|
 
-    'DevWorkst [info]: errorInterrupt: ' infoPrint. errID infoPrintCR.
+    'DeviceWorkstation [info]: errorInterrupt: ' infoPrint. errID infoPrintCR.
 
     errID notNil ifTrue:[
         "/
@@ -504,19 +504,25 @@
             (p notNil and:[p ~~ Processor activeProcess]) ifTrue:[
                 'DeviceWorkstation [info]: interrupting: ' infoPrint. p displayString infoPrintCR.
                 p interruptWith:[
-                    'broken connection' infoPrintCR.
+                    'DeviceWorkstation [warning]: raising - exception' errorPrintCR.
+                    theSignal mayProceed ifTrue:[
+                        theSignal raiseRequestWith:badResource errorString:msg.
+                    ] ifFalse:[
+                        theSignal raiseWith:badResource errorString:msg.
+                    ].
+                    'DeviceWorkstation [warning]: broken connection' errorPrintCR.
                     theDevice brokenConnection.
-"/                    theSignal mayProceed ifTrue:[
-"/                        theSignal raiseRequestWith:badResource errorString:msg.
-"/                    ] ifFalse:[
-"/                        theSignal raiseWith:badResource errorString:msg.
-"/                    ].
+                    'DeviceWorkstation [warning]: stopping dispatch' errorPrintCR.
                     theDevice stopDispatch.
                 ].
-
-                Processor reschedule.
+                ^ self.
+"/                Processor reschedule.
+"/                AbortSignal raise.
+            ].
+            theDevice brokenConnection.
+            p == Processor activeProcess ifTrue:[
                 AbortSignal raise.
-            ].
+            ]
         ].
 
         "/ 'broken connection' printCR.
@@ -524,20 +530,21 @@
         ^ self.
     ].
 
-    'DeviceWorkstation [info]: interrupting current process: ' infoPrint. 
-    Processor activeProcess displayString infoPrintCR.
-
-    theSignal mayProceed ifTrue:[
-        theSignal
-            raiseRequestWith:badResource 
-            errorString:msg.
-    ] ifFalse:[
-        theSignal
-            raiseWith:badResource 
-            errorString:msg.
+    theSignal isHandled ifTrue:[
+"/        'DeviceWorkstation [info]: interrupting current process: ' infoPrint. 
+"/        Processor activeProcess displayString infoPrintCR.
+
+        theSignal mayProceed ifTrue:[
+            theSignal
+                raiseRequestWith:badResource 
+                errorString:msg.
+        ] ifFalse:[
+            theSignal
+                raiseWith:badResource 
+                errorString:msg.
+        ].
     ].
-
-    AbortSignal raise.
+"/    AbortSignal raise.
 
     "Modified: 11.4.1997 / 11:28:27 / cg"
 !
@@ -3965,26 +3972,31 @@
     p := [
         self initializeDeviceResources.
 
-        [
-            [dispatching] whileTrue:[
-                AbortSignal handle:[:ex |
-                    ex return
-                ] do:[
-                    self eventPending ifFalse:[
-                        Processor activeProcess setStateTo:#ioWait if:#active.
-                        inputSema wait.
-                    ].
-
-                    self dispatchPendingEvents.
+        DeviceIOErrorSignal handle:[:ex |
+            'DeviceWorkstation [warning]: stop dispatch due to I/O error' errorPrintCR.
+            ex return.
+        ] do:[
+            [
+                [dispatching] whileTrue:[
+                    AbortSignal handle:[:ex |
+                        ex return
+                    ] do:[
+                        self eventPending ifFalse:[
+                            Processor activeProcess setStateTo:#ioWait if:#active.
+                            inputSema wait.
+                        ].
+
+                        self dispatchPendingEvents.
+                    ]
                 ]
-            ]
-        ] valueNowOrOnUnwindDo:[
-            inputSema notNil ifTrue:[
-                Processor disableSemaphore:inputSema.
-                inputSema := nil.
+            ] valueNowOrOnUnwindDo:[
+                inputSema notNil ifTrue:[
+                    Processor disableSemaphore:inputSema.
+                    inputSema := nil.
+                ].
+                dispatchProcess := nil.
+                self close.
             ].
-            dispatchProcess := nil.
-            self close.
         ].
     ] newProcess.
 
@@ -6765,6 +6777,6 @@
 !DeviceWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.345 1999-10-28 18:14:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.346 1999-10-29 09:42:20 stefan Exp $'
 ! !
 DeviceWorkstation initialize!