Pre-Proposal: Linguistic support for locks

Reinier Zwitserloot reinier at
Mon Mar 9 03:05:37 PDT 2009

Ditto - try is the wrong keyword for this one. protected works great.  
Also gets rid of the 'you can add catch / finally blocks at the end  
for consistency' device, which really doesn't make too much sense for  

  --Reinier Zwitserloot
Like it? Tip it!

On Mar 9, 2009, at 00:56, Jesse Wilson wrote:

> On Sun, Mar 8, 2009 at 11:20 AM, Joshua Bloch <jjb at> wrote:
>>   try (<lock-expr>) {
>>       <code>
>>   }
> try is definitely the wrong keyword here. Mostly because there's  
> already a
> method Lock.tryLock() that is not at all related to this sweet sugar.
>  1. Use the protected keyword in place of try.
> This is fantastic. I especially like that proper Locks would become  
> just as
> easy-to-use as the built-in monitor on Object.

More information about the coin-dev mailing list