blob: f518f54be8def1818a513e00402488112aa5981b [file]
<html devsite="true">
<head>
<title>AnyThread</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<div itemscope="" itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="AnyThread">
<meta itemprop="path" content="androidx.annotation">
<meta itemprop="language" content="JAVA">
</div>
<div id="header-block">
<div>
<h1>AnyThread</h1>
</div>
<div id="metadata-info-block">
<div id="source-link"><a href="https://cs.android.com/search?q=file:androidx/annotation/AnyThread.kt+class:androidx.annotation.AnyThread&amp;ss=androidx/platform/frameworks/support" class="external">View Source</a></div>
</div>
</div>
<div id="refdoc-switcher-placeholder"></div>
<p>
<pre>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-must-be-documented/index.html">MustBeDocumented</a><br>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-retention/index.html">Retention</a>(value&nbsp;=&nbsp;AnnotationRetention.BINARY)<br>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-target/index.html">Target</a>(allowedTargets&nbsp;=&nbsp;[AnnotationTarget.FUNCTION,&nbsp;AnnotationTarget.PROPERTY_GETTER,&nbsp;AnnotationTarget.PROPERTY_SETTER,&nbsp;AnnotationTarget.CONSTRUCTOR,&nbsp;AnnotationTarget.ANNOTATION_CLASS,&nbsp;AnnotationTarget.CLASS,&nbsp;AnnotationTarget.VALUE_PARAMETER])<br>public annotation <a href="/reference/androidx/annotation/AnyThread.html">AnyThread</a></pre>
</p>
<hr>
<p>Denotes that the annotated method can be called from any thread (e.g. it is &quot;thread safe&quot;.) If the annotated element is a class, then all methods in the class can be called from any thread.</p>
<p>The main purpose of this method is to indicate that you believe a method can be called from any thread; static tools can then check that nothing you call from within this method or class have more strict threading requirements.</p>
<p>Example:</p>
<pre class="prettyprint">@AnyThread<br>public void deliverResult(D data) { ... }</pre>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Public constructors</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td>
<div><code><a href="/reference/androidx/annotation/AnyThread.html#AnyThread()">AnyThread</a>()</code></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="list">
<h2>Public constructors</h2>
<div class="api-item"><a name="AnyThread--"></a><a name="anythread"></a>
<div class="api-name-block">
<div>
<h3 id="AnyThread()">AnyThread</h3>
</div>
</div>
<pre class="api-signature no-pretty-print">public&nbsp;<a href="/reference/androidx/annotation/AnyThread.html#AnyThread()">AnyThread</a>()</pre>
</div>
</div>
</body>
</html>