001    package edu.rice.cs.cunit.threadCheck.predicates;
002    
003    import edu.rice.cs.cunit.threadCheck.PredicateLink;
004    
005    import java.lang.annotation.Retention;
006    import java.lang.annotation.RetentionPolicy;
007    import java.lang.annotation.Target;
008    import java.lang.annotation.ElementType;
009    
010    /**
011     * An annotation used to designate methods that are only allowed to be run when the
012     * monitor of "this" is owned.
013     * @author Mathias Ricken
014     */
015    @Retention(RetentionPolicy.RUNTIME)
016    @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE})
017    
018    @PredicateLink(value = ThreadCheckPredicates.class, method = "checkMonitorOwned")
019    public @interface OnlySynchronizedThis {
020    }