Annotation Type Synchronized
-
@Documented @Target({METHOD,TYPE}) @Retention(RUNTIME) public @interface Synchronized
Instead of synchronized methods you can mark these methods as "@Synchronized". The SynchronizedAspect in patterntesting.concurrent will use ReentrantLock to realize it and to avoid deadlocks. If you set the log level to TRACE you can get additional information about the locks and waiting threads.The default value for the timeout is 1800 seconds (30 minutes). If you want a shorter value you can use the timeout and unit attributes. Example:
@Synchronized(timeout=10, unit=TimeUnit.SECONDS)
will set the timeout to 10 seconds.- Since:
- 13.11.2008
- Author:
- oliver
- See Also:
TimeUnit