pharo: The TimerDispatcher needs more work on Pharo for image resume
In Pharo the Delay>>wait for one second will not expire anytime soon in a new image. Use the depedency handling so we can terminate and restart the loop.
This commit is contained in:
parent
9807973a46
commit
ced5898a31
3
Makefile
3
Makefile
|
@ -14,4 +14,5 @@ all:
|
||||||
|
|
||||||
convert:
|
convert:
|
||||||
$(GST_CONVERT) $(CONVERT_RULES) -F squeak -f gst \
|
$(GST_CONVERT) $(CONVERT_RULES) -F squeak -f gst \
|
||||||
-o fileout.st compat_for_pharo.st LogArea.st Dispatcher.st Timer.st Tests.st
|
-o fileout.st compat_for_pharo.st LogArea.st Dispatcher.st Timer.st Tests.st \
|
||||||
|
changes_for_pharo.st
|
||||||
|
|
13
Timer.st
13
Timer.st
|
@ -94,11 +94,24 @@ bit difficult to do this race free.'>
|
||||||
quit := true.
|
quit := true.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
platformInit [
|
||||||
|
<category: 'creation'>
|
||||||
|
"Nothing for GST..."
|
||||||
|
]
|
||||||
|
|
||||||
initialize [
|
initialize [
|
||||||
<category: 'private'>
|
<category: 'private'>
|
||||||
queue := SortedCollection sortBlock: [:a :b | a timeout < b timeout].
|
queue := SortedCollection sortBlock: [:a :b | a timeout < b timeout].
|
||||||
sem := Semaphore forMutualExclusion.
|
sem := Semaphore forMutualExclusion.
|
||||||
quit := false.
|
quit := false.
|
||||||
|
self
|
||||||
|
startLoop;
|
||||||
|
platformInit.
|
||||||
|
]
|
||||||
|
|
||||||
|
startLoop [
|
||||||
|
<category: 'creation'>
|
||||||
|
|
||||||
loop := [Processor activeProcess name: 'Osmo Timers'.
|
loop := [Processor activeProcess name: 'Osmo Timers'.
|
||||||
self runTimers] fork.
|
self runTimers] fork.
|
||||||
]
|
]
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
TimerScheduler extend [
|
||||||
|
TimerScheduler class >> startUp [
|
||||||
|
Smalltalk at: #OsmoTimeScheduler ifPresent: [
|
||||||
|
OsmoTimeScheduler reinitialize.
|
||||||
|
].
|
||||||
|
]
|
||||||
|
|
||||||
|
platformInit [
|
||||||
|
<category: 'creation'>
|
||||||
|
"Pharo requires us to do some post-processing"
|
||||||
|
Smalltalk addToStartUpList: self class.
|
||||||
|
]
|
||||||
|
|
||||||
|
reinitialize [
|
||||||
|
<category: 'creation'>
|
||||||
|
loop terminate.
|
||||||
|
self startLoop.
|
||||||
|
]
|
||||||
|
]
|
Reference in New Issue