smalltalk
/
osmo-st-all
Archived
1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-all/osmo-st-core/changes_for_pharo.st

40 lines
1.0 KiB
Smalltalk

TimerScheduler extend [
TimerScheduler class >> initialize [
<category: 'loading'>
"Pharo requires us to do some post-processing"
Smalltalk addToStartUpList: self.
Smalltalk addToShutDownList: self.
^self instance.
]
TimerScheduler class >> startUp [
Smalltalk at: #OsmoTimeScheduler ifPresent: [:timer | timer doStartUp].
]
TimerScheduler class >> shutDown: quitting [
Smalltalk at: #OsmoTimeScheduler ifPresent: [:timer | timer doShutDown].
]
doShutDown [
<category: 'PharoHacks'>
loop ifNil: [^self].
quit := true.
processExited wait.
Transcript nextPutAll: 'Stopped the TimerScheduler process'; cr.
]
doStartUp [
<category: 'PharoHacks'>
loop ifNotNil: [^self error: 'The loop should have vanished'].
Transcript nextPutAll: 'Starting the TimerScheduler loop again'; cr.
quit := false.
self startLoop.
]
]
Dispatcher class extend [
initialize [
^ self instance
]
]