Comment #1 on issue 3428 by stephane.ducasse: Semaphore Enh http://code.google.com/p/pharo/issues/detail?id=3428 A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-ul.523.mcz ==================== Summary ==================== Name: Kernel-ul.523 Author: ul Time: 8 December 2010, 4:45:41.467 am UUID: 809ca265-c5de-ac47-b6d6-226f80cf9245 Ancestors: Kernel-ul.522 - added Semaphore >> #waitIfLocked: =============== Diff against Kernel-ul.522 =============== Item was added: + ----- Method: Semaphore>>waitIfLocked: (in category 'communication') ----- + waitIfLocked: aBlock + "Use a signal if available, otherwise evaluate aBlock" + + excessSignals == 0 ifTrue: [ ^aBlock value ]. + excessSignals := excessSignals - 1! Not eliot proposed waitIfLocked: aBlock "Use a signal if available, otherwise evaluate aBlock" excessSignals == 0 ifTrue: [ ^aBlock valueNoContextSwitch ]. excessSignals := excessSignals - 1 ?