The Trunk: Kernel-tonyg.1151.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-tonyg.1151.mcz

commits-2
Tony Garnock-Jones uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-tonyg.1151.mcz

==================== Summary ====================

Name: Kernel-tonyg.1151
Author: tonyg
Time: 9 February 2018, 12:55:51.129682 pm
UUID: b5708007-672e-4c5e-a6b6-8cfab8dab44b
Ancestors: Kernel-tonyg.1150

Update Promise >> #waitTimeoutMSecs: to stop waiting if the promise is rejected, as well as if it's accepted.

=============== Diff against Kernel-tonyg.1150 ===============

Item was changed:
  ----- Method: Promise>>waitTimeoutMSecs: (in category 'waiting') -----
  waitTimeoutMSecs: msecs
+ "Wait for at most the given number of milliseconds for this promise to settle.
+ Answer true if it is resolved, false otherwise. False can therefore mean EITHER 'timeout' OR 'rejected'."
- "Wait for at most the given number of milliseconds for this promise to resolve. Answer true if it is resolved, false otherwise."
  | sema delay |
  sema := Semaphore new.
  self whenResolved: [sema signal].
+ self whenRejected: [sema signal].
  delay := Delay timeoutSemaphore: sema afterMSecs: msecs.
  [sema wait] ensure: [delay unschedule].
  ^ self isResolved.!