hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1050254 - /httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
Date Fri, 17 Dec 2010 00:28:01 GMT
Author: sebb
Date: Fri Dec 17 00:28:00 2010
New Revision: 1050254

URL: http://svn.apache.org/viewvc?rev=1050254&view=rev
Log:
Document thread safety

Modified:
    httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java?rev=1050254&r1=1050253&r2=1050254&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
(original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
Fri Dec 17 00:28:00 2010
@@ -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 
     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
 



Mime
View raw message