'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 18 June 2003 at 7:37:21 am'! "Change Set: CPUWatcherShutDown-nk Date: 18 June 2003 Author: Ned Konz This change set adds startup/shutdown behavior to the CPUWatcher and the ProcessBrowsers. It will make the CPUWatcher stop and restart across image saves, and it will make ProcessBrowser instances resume updating properly. (merged conflict with more recent change (#5189) in ProcessBrowser class>>initialize -dew) "! Model subclass: #ProcessBrowser instanceVariableNames: 'selectedProcess selectedContext methodText processList processListIndex stackList stackListIndex sourceMap selectedClass selectedSelector searchString autoUpdateProcess deferredMessageRecipient lastUpdate startedCPUWatcher ' classVariableNames: 'Browsers SuspendedProcesses ' poolDictionaries: '' category: 'Tools-Process Browser'! !CPUWatcher class methodsFor: 'as yet unclassified' stamp: 'nk 6/18/2003 07:15'! initialize "CPUWatcher initialize" Smalltalk addToStartUpList: self. Smalltalk addToShutDownList: self.! ! !CPUWatcher class methodsFor: 'as yet unclassified' stamp: 'nk 6/18/2003 07:14'! shutDown self stopMonitoring.! ! !CPUWatcher class methodsFor: 'as yet unclassified' stamp: 'nk 6/18/2003 07:14'! startUp self monitorPreferenceChanged.! ! !ProcessBrowser methodsFor: 'updating' stamp: 'nk 6/18/2003 07:20'! isAutoUpdatingPaused ^autoUpdateProcess notNil and: [ autoUpdateProcess isSuspended ]! ! !ProcessBrowser methodsFor: 'updating' stamp: 'nk 6/18/2003 07:20'! pauseAutoUpdate self isAutoUpdating ifTrue: [ autoUpdateProcess suspend ]. self updateProcessList! ! !ProcessBrowser methodsFor: 'updating' stamp: 'nk 6/18/2003 07:21'! startAutoUpdate self isAutoUpdatingPaused ifTrue: [ ^autoUpdateProcess resume ]. self isAutoUpdating ifFalse: [| delay | delay _ Delay forSeconds: 2. autoUpdateProcess _ [[self hasView] whileTrue: [delay wait. deferredMessageRecipient ifNotNil: [ deferredMessageRecipient addDeferredUIMessage: [self updateProcessList]] ifNil: [ self updateProcessList ]]. autoUpdateProcess _ nil] fork]. self updateProcessList! ! !ProcessBrowser methodsFor: 'updating' stamp: 'nk 6/18/2003 07:22'! stopAutoUpdate autoUpdateProcess ifNotNil: [ autoUpdateProcess terminate. autoUpdateProcess _ nil]. self updateProcessList! ! !ProcessBrowser class methodsFor: 'as yet unclassified' stamp: 'nk 6/18/2003 07:31'! initialize "ProcessBrowser initialize" Browsers ifNil: [ Browsers _ WeakSet new ]. SuspendedProcesses ifNil: [ SuspendedProcesses _ IdentityDictionary new ]. Smalltalk addToStartUpList: self. Smalltalk addToShutDownList: self. self registerInFlapsRegistry.! ! !ProcessBrowser class methodsFor: 'as yet unclassified' stamp: 'nk 6/18/2003 07:32'! shutDown Browsers do: [ :ea | ea isAutoUpdating ifTrue: [ ea pauseAutoUpdate ]]! ! !ProcessBrowser class methodsFor: 'as yet unclassified' stamp: 'nk 6/18/2003 07:32'! startUp Browsers do: [ :ea | ea isAutoUpdatingPaused ifTrue: [ ea startAutoUpdate ]]! ! ProcessBrowser initialize! CPUWatcher initialize!