Christoph Thiede uploaded a new version of Chronology-Core to project The Treated Inbox: http://source.squeak.org/treated/Chronology-Core-jar.89.mcz
==================== Summary ====================
Name: Chronology-Core-jar.89 Author: jar Time: 5 January 2024, 1:35:51.398632 am UUID: d4f4b018-1b84-1c4a-910e-428004aac88c Ancestors: Chronology-Core-mt.88
suggest a patch for Christoph's example in https://github.com/squeak-smalltalk/squeak-object-memory/issues/108
=============== Diff against Chronology-Core-mt.88 ===============
Item was changed: ----- Method: BlockClosure>>valueWithin:onTimeout: (in category '*chronology-core') ----- valueWithin: aDuration onTimeout: timeoutBlock "Evaluate the receiver. If the evaluation does not complete in less than aDuration evaluate the timeoutBlock instead"
| theProcess delay watchdog tag |
aDuration <= Duration zero ifTrue: [^ timeoutBlock value ].
"the block will be executed in the current process" theProcess := Processor activeProcess. delay := aDuration asDelay. tag := self.
"make a watchdog process" watchdog := [ delay wait. "wait for timeout or completion" + (theProcess notNil and: [theProcess isTerminated not]) ifTrue: [theProcess signalException: (TimedOut new tag: tag)] - theProcess ifNotNil:[ theProcess signalException: (TimedOut new tag: tag)] ] newProcess.
"Watchdog needs to run at high priority to do its job (but not at timing priority)" watchdog priority: Processor timingPriority-1.
"catch the timeout signal" ^ [ watchdog resume. "start up the watchdog" self ensure:[ "evaluate the receiver" theProcess := nil. "it has completed, so ..." delay delaySemaphore signal. "arrange for the watchdog to exit" ]] on: TimedOut do: [ :e | e tag == tag ifTrue:[ timeoutBlock value ] ifFalse:[ e pass]].!
packages@lists.squeakfoundation.org