'From Squeak3.1alpha of 28 February 2001 [latest update: #4274] on 22 August 2001 at 5:41:11 pm'! "Change Set: InterruptFix-ar Date: 22 August 2001 Author: Andreas Raab Fixes the handling of user interrupts. Formerly, only the UI process was interrupted which could result in a hosed system if there was any other process running (e.g., something like '[[true] whileTrue] fork'). The new scheme asks Processor for the process that was preempted when pressing CMD-Period so that we will actually interrupt the process being active when the interrupt came in."! !ProcessorScheduler methodsFor: 'accessing' stamp: 'ar 8/22/2001 17:33'! preemptedProcess "Return the process that the currently active process just preempted." | list | activeProcess priority to: 1 by: -1 do:[:priority| list _ quiescentProcessLists at: priority. list isEmpty ifFalse:[^list last]. ]. ^nil "Processor preemptedProcess"! ! !Project class methodsFor: 'utilities' stamp: 'ar 8/22/2001 17:37'! interruptName: labelString "Create a Notifier on the active scheduling process with the given label." | preemptedProcess | Smalltalk isMorphic ifFalse: [^ ScheduledControllers interruptName: labelString]. ActiveHand ifNotNil:[ActiveHand interrupted]. ActiveWorld _ World. "reinstall active globals" ActiveHand _ World primaryHand. ActiveHand interrupted. "make sure this one's interrupted too" ActiveEvent _ nil. preemptedProcess _ Processor preemptedProcess suspend offList. Debugger openInterrupt: labelString onProcess: preemptedProcess ! !