Pre-Proposal: Linguistic support for locks

Jesse Wilson jesse at
Sun Mar 8 16:56:45 PDT 2009

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