001 package edu.rice.cs.cunit.threadCheck.predicates; 002 003 import edu.rice.cs.cunit.threadCheck.PredicateLink; 004 import edu.rice.cs.cunit.threadCheck.Combine; 005 006 import java.lang.annotation.Retention; 007 import java.lang.annotation.RetentionPolicy; 008 import java.lang.annotation.Target; 009 import java.lang.annotation.ElementType; 010 011 /** 012 * An annotation used to designate methods that are only allowed to be run when the 013 * monitor of the method argument indexed by value is not owned. 014 * @author Mathias Ricken 015 */ 016 @Retention(RetentionPolicy.RUNTIME) 017 @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE}) 018 019 @PredicateLink(value = ThreadCheckPredicates.class, method = "checkMonitorNotOwnedArgument", arguments = true) 020 public @interface NotSynchronizedArgument { 021 int value(); 022 023 // 024 // nested interfaces 025 // 026 027 /** 028 * Annotation used to designate methods that are not allowed to be own any of the monitors 029 * of the fields specified, i.e. the individual @NotSynchronizedArgument annotations are 030 * combined using AND. 031 */ 032 @Retention(RetentionPolicy.RUNTIME) 033 @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE}) 034 035 @Combine(value = Combine.Mode.AND, arguments = true) 036 public static @interface None { 037 NotSynchronizedArgument[] value(); 038 } 039 }