Package com.helger.commons.annotation
Annotation Type MustBeLocked
-
@Retention(CLASS) @Target(METHOD) @Documented public @interface MustBeLocked
Just to indicate that a method must be called inside a lock. When using read-write locks (class ReadWriteLock), please choose the lock type carefully. When using exclusive locks (class Lock) use the lock typeWRITE. The constraint of this annotation is also fulfilled when a method is called inside the constructor of the owning class, as constructor-calls of a single object are not accessed by multiple threads in parallel.- Author:
- Philip Helger