lombok-pg -

lombok
Annotation Type ReadLock


@Target(value=METHOD)
@Retention(value=SOURCE)
public @interface ReadLock

Locking beyond @Synchronized.

 void methodAnnotatedWithReadLock() {
   this.<LOCK_NAME>.readLock().lock();
   try {
 
     // method body
 
   } finally {
     this.<LOCK_NAME>.readLock().unlock();
   }
 }
 
 


Required Element Summary
 String value
          Name of the lock.
 

Element Detail

value

public abstract String value
Name of the lock.

If no lock with the specified name exists a new ReadWriteLock will be created, using this name.


lombok-pg -

Copyright © 2010-2011 Philipp Eichhorn, licensed under the MIT licence.