From: khaines@... Date: 2006-08-12T04:45:12+09:00 Subject: Re: How absurd is this? On Sat, 12 Aug 2006, Martin DeMello wrote: > On 8/12/06, khaines@enigo.com wrote: >> Imagine you have in a method a block. Sometimes you will want that block >> to be executed via a mutex.synchronize() call. And sometimes you don't >> want to synchronize. > > I'd add a Mutex#synchronize_unless > > def method_with_a_block > @mutex.synchronize_unless(dont_lock_here()) do > puts "This block may or may not be synchronized, depending on whether > dont_lock_here() returned true or false." > end > end That's perfect. And obvious. :) Thanks much for helping me see it. Kirk Haines