From 4eec65b378c661ef25b22328c2fa6ae5092e5558 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Fri, 17 Dec 2010 00:28:00 +0000 Subject: [PATCH] Document thread safety git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1050254 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/http/entity/mime/MultipartEntity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java b/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java index efc530163..2d87ccd66 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java @@ -35,6 +35,7 @@ import java.util.Random; import org.apache.http.Header; import org.apache.http.HttpEntity; +import org.apache.http.annotation.GuardedBy; import org.apache.http.entity.mime.content.ContentBody; import org.apache.http.message.BasicHeader; import org.apache.http.protocol.HTTP; @@ -56,6 +57,7 @@ public class MultipartEntity implements HttpEntity { private final HttpMultipart multipart; private final Header contentType; + @GuardedBy("dirty") // we always read dirty before accessing length private long length; private volatile boolean dirty; // used to decide whether to recalculate length