smalltalk
/
osmo-st-core
Archived
1
0
Fork 0

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:
Holger Hans Peter Freyther 2013-02-20 09:34:21 +01:00
parent 9807973a46
commit ced5898a31
3 changed files with 34 additions and 1 deletions

View File

@ -14,4 +14,5 @@ all:
convert:
$(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

View File

@ -94,11 +94,24 @@ bit difficult to do this race free.'>
quit := true.
]
platformInit [
<category: 'creation'>
"Nothing for GST..."
]
initialize [
<category: 'private'>
queue := SortedCollection sortBlock: [:a :b | a timeout < b timeout].
sem := Semaphore forMutualExclusion.
quit := false.
self
startLoop;
platformInit.
]
startLoop [
<category: 'creation'>
loop := [Processor activeProcess name: 'Osmo Timers'.
self runTimers] fork.
]

19
changes_for_pharo.st Normal file
View File

@ -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.
]
]