#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Fri, 31 Mar 2017 13:13:22 +0200
changeset 21677 be534b086fb0
parent 21676 3f8d5056f05c
child 21678 f765433a638d
#BUGFIX by cg class: ProcessorScheduler changed: #vmSuspendInterrupt: do not enter MiniDebugger if standalone
ProcessorScheduler.st
--- a/ProcessorScheduler.st	Fri Mar 31 13:10:47 2017 +0200
+++ b/ProcessorScheduler.st	Fri Mar 31 13:13:22 2017 +0200
@@ -1112,19 +1112,19 @@
     |pri l newState|
 
     OperatingSystem interruptsBlocked ifFalse:[
-	MiniDebugger
-	    enterWithMessage:'immediateInterrupt with no interruptsBlocked'
-	    mayProceed:true.
+        MiniDebugger
+            enterWithMessage:'immediateInterrupt with no interruptsBlocked'
+            mayProceed:true.
     ].
 
     (whyCode == 2) ifTrue:[
-	 newState := #wrapWait.
+         newState := #wrapWait.
     ] ifFalse:[
-	(whyCode == 3) ifTrue:[
-	    newState := #osWait.
-	] ifFalse:[
-	    newState := #stopped.
-	].
+        (whyCode == 3) ifTrue:[
+            newState := #osWait.
+        ] ifFalse:[
+            newState := #stopped.
+        ].
     ].
     activeProcess setStateTo:newState if:#active.
 
@@ -1135,10 +1135,19 @@
      the ifAbsent block, because [] is a shared cheap block, created at compile time
     "
     (l isNil or:[(l removeIdentical:activeProcess ifAbsent:nil) isNil]) ifTrue:[
-	"/ 'Processor [warning]: bad vmSuspendInterrupt: not on run list' errorPrintCR.
-	MiniDebugger enterWithMessage:'bad vmSuspendInterrupt: not on run list' mayProceed:true.
-	^ self
+        "/ the vm wants to suspend a not running thread.
+        "/ should not, but does happen, although very seldom (a race condition?)
+        "/ ignore in standalone apps; enter a minidebugger if not.
+        "/ it is (currently not clear, how this happens, but seems to be harmless)
+        Logger warning:'Processor [warning]: bad vmSuspendInterrupt: process not on run list'.
+        "/ 'Processor [warning]: bad vmSuspendInterrupt: not on run list' errorPrintCR.
+        (Smalltalk isStandAloneApp and:[Smalltalk isStandAloneDebug not]) ifFalse:[
+            MiniDebugger enterWithMessage:'bad vmSuspendInterrupt: not on run list' mayProceed:true.
+        ].    
+        ^ self
     ].
+
+    "Modified: / 31-03-2017 / 13:12:49 / cg"
 ! !
 
 !ProcessorScheduler methodsFor:'os process handling'!