summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2010-08-31 09:42:12 -0700
committerMakoto Onuki <omakoto@google.com>2010-09-08 10:06:19 -0700
commitaa60a02f7934ac23cb88f16ed2d726157bc9f31c (patch)
treef57e99af1a6d6996ffffc616f9c8449febec219f /core/java
parent5c3ae02d10aca62952f2b5415391b33545a3fb13 (diff)
downloadframeworks_base-aa60a02f7934ac23cb88f16ed2d726157bc9f31c.zip
frameworks_base-aa60a02f7934ac23cb88f16ed2d726157bc9f31c.tar.gz
frameworks_base-aa60a02f7934ac23cb88f16ed2d726157bc9f31c.tar.bz2
Added "Memory observability" to javadoc.
Change-Id: I4fba91922f033af408903cc4b455daa291e3f6ac
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/AsyncTask.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/os/AsyncTask.java b/core/java/android/os/AsyncTask.java
index aadacab..d2f3d64 100644
--- a/core/java/android/os/AsyncTask.java
+++ b/core/java/android/os/AsyncTask.java
@@ -123,6 +123,16 @@ import java.util.concurrent.atomic.AtomicInteger;
* <li>The task can be executed only once (an exception will be thrown if
* a second execution is attempted.)</li>
* </ul>
+ *
+ * <h2>Memory observability</h2>
+ * <p>AsyncTask guarantees that all callback calls are synchronized in such a way that the following
+ * operations are safe without explicit synchronizations.</p>
+ * <ul>
+ * <li>Set member fields in the constructor or {@link #onPreExecute}, and refer to them
+ * in {@link #doInBackground}.
+ * <li>Set member fields in {@link #doInBackground}, and refer to them in
+ * {@link #onProgressUpdate} and {@link #onPostExecute}.
+ * </ul>
*/
public abstract class AsyncTask<Params, Progress, Result> {
private static final String LOG_TAG = "AsyncTask";