[Q] I find this code in 3.9 image and wish know if is correct
Lic. Edgar J. De Cleene
edgardec2001 at yahoo.com.ar
Fri Aug 12 11:05:48 UTC 2005
valueWithin: aDuration onTimeout: timeoutBlock
"Evaluate the receiver.
If the evaluation does not complete in less than aDuration evaluate the
timeoutBlock instead"
| theProcess delay watchdog done result |
aDuration <= Duration zero ifTrue: [^ timeoutBlock value ].
"the block will be executed in the current process"
theProcess := Processor activeProcess.
delay := aDuration asDelay.
"make a watchdog process"
watchdog := [
delay wait. "wait for timeout or completion"
done ifFalse: [ theProcess signalException: TimedOut ]
] newProcess.
"watchdog needs to run at high priority to do its job"
watchdog priority: Processor timingPriority.
"catch the timeout signal"
^ [ done := false.
watchdog resume. "start up the watchdog"
result := self value. "evaluate the receiver"
done is undefined before evaluation.
I try to feed SqueakLight with methods what have 2005 timestamp,but
complaints for this one.
Edgar
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar
More information about the Squeak-dev
mailing list
|