Martin DeMello
8/11/2006 7:28:00 PM
On 8/12/06, khaines@enigo.com <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
martin