10957cc268e013e48e0350c232e499258fac2dd6aTor Norbye/* 20957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * Copyright (C) 2016 The Android Open Source Project 30957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * 40957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * Licensed under the Apache License, Version 2.0 (the "License"); 50957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * you may not use this file except in compliance with the License. 60957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * You may obtain a copy of the License at 70957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * 80957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * http://www.apache.org/licenses/LICENSE-2.0 90957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * 100957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * Unless required by applicable law or agreed to in writing, software 110957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * distributed under the License is distributed on an "AS IS" BASIS, 120957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * See the License for the specific language governing permissions and 140957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * limitations under the License. 150957cc268e013e48e0350c232e499258fac2dd6aTor Norbye */ 160957cc268e013e48e0350c232e499258fac2dd6aTor Norbyepackage android.support.annotation; 170957cc268e013e48e0350c232e499258fac2dd6aTor Norbye 180957cc268e013e48e0350c232e499258fac2dd6aTor Norbyeimport static java.lang.annotation.ElementType.CONSTRUCTOR; 190957cc268e013e48e0350c232e499258fac2dd6aTor Norbyeimport static java.lang.annotation.ElementType.METHOD; 200957cc268e013e48e0350c232e499258fac2dd6aTor Norbyeimport static java.lang.annotation.ElementType.TYPE; 210957cc268e013e48e0350c232e499258fac2dd6aTor Norbyeimport static java.lang.annotation.RetentionPolicy.CLASS; 220957cc268e013e48e0350c232e499258fac2dd6aTor Norbye 23bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikasimport java.lang.annotation.Documented; 24bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikasimport java.lang.annotation.Retention; 25bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikasimport java.lang.annotation.Target; 26bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikas 270957cc268e013e48e0350c232e499258fac2dd6aTor Norbye/** 280957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * Denotes that the annotated method can be called from any thread (e.g. it is "thread safe".) 290957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * If the annotated element is a class, then all methods in the class can be called 300957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * from any thread. 310957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * <p> 320957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * The main purpose of this method is to indicate that you believe a method can be called 330957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * from any thread; static tools can then check that nothing you call from within this method 340957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * or class have more strict threading requirements. 350957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * <p> 360957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * Example: 370957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * <pre><code> 380957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * @AnyThread 390957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * public void deliverResult(D data) { ... } 400957cc268e013e48e0350c232e499258fac2dd6aTor Norbye * </code></pre> 410957cc268e013e48e0350c232e499258fac2dd6aTor Norbye */ 420957cc268e013e48e0350c232e499258fac2dd6aTor Norbye@Documented 430957cc268e013e48e0350c232e499258fac2dd6aTor Norbye@Retention(CLASS) 440957cc268e013e48e0350c232e499258fac2dd6aTor Norbye@Target({METHOD,CONSTRUCTOR,TYPE}) 450957cc268e013e48e0350c232e499258fac2dd6aTor Norbyepublic @interface AnyThread { 460957cc268e013e48e0350c232e499258fac2dd6aTor Norbye} 47