You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/10/11 19:47:16 UTC

svn commit: r1631092 - in /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol: BasicAsyncRequestProducer.java BasicAsyncResponseProducer.java

Author: olegk
Date: Sat Oct 11 17:47:15 2014
New Revision: 1631092

URL: http://svn.apache.org/r1631092
Log:
Do not synchronize methods of BasicAsyncRequestProducer and BasicAsyncResponseProducer

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java?rev=1631092&r1=1631091&r2=1631092&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java Sat Oct 11 17:47:15 2014
@@ -32,7 +32,6 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
-import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.nio.ContentEncoder;
 import org.apache.http.nio.IOControl;
 import org.apache.http.nio.entity.EntityAsyncContentProducer;
@@ -50,7 +49,6 @@ import org.apache.http.util.Args;
  *
  * @since 4.2
  */
-@ThreadSafe
 public class BasicAsyncRequestProducer implements HttpAsyncRequestProducer {
 
     private final HttpHost target;
@@ -111,7 +109,7 @@ public class BasicAsyncRequestProducer i
     }
 
     @Override
-    public synchronized HttpRequest generateRequest() {
+    public HttpRequest generateRequest() {
         return this.request;
     }
 
@@ -121,7 +119,7 @@ public class BasicAsyncRequestProducer i
     }
 
     @Override
-    public synchronized void produceContent(
+    public void produceContent(
             final ContentEncoder encoder, final IOControl ioctrl) throws IOException {
         if (this.producer != null) {
             this.producer.produceContent(encoder, ioctrl);
@@ -140,19 +138,19 @@ public class BasicAsyncRequestProducer i
     }
 
     @Override
-    public synchronized boolean isRepeatable() {
+    public boolean isRepeatable() {
         return this.producer == null || this.producer.isRepeatable();
     }
 
     @Override
-    public synchronized void resetRequest() throws IOException {
+    public void resetRequest() throws IOException {
         if (this.producer != null) {
             this.producer.close();
         }
     }
 
     @Override
-    public synchronized void close() throws IOException {
+    public void close() throws IOException {
         if (this.producer != null) {
             this.producer.close();
         }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java?rev=1631092&r1=1631091&r2=1631092&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java Sat Oct 11 17:47:15 2014
@@ -31,7 +31,6 @@ import java.io.IOException;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
-import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.nio.ContentEncoder;
 import org.apache.http.nio.IOControl;
 import org.apache.http.nio.entity.EntityAsyncContentProducer;
@@ -50,7 +49,6 @@ import org.apache.http.util.Args;
  *
  * @since 4.2
  */
-@ThreadSafe
 public class BasicAsyncResponseProducer implements HttpAsyncResponseProducer {
 
     private final HttpResponse response;
@@ -100,12 +98,12 @@ public class BasicAsyncResponseProducer 
     }
 
     @Override
-    public synchronized HttpResponse generateResponse() {
+    public HttpResponse generateResponse() {
         return this.response;
     }
 
     @Override
-    public synchronized void produceContent(
+    public void produceContent(
             final ContentEncoder encoder, final IOControl ioctrl) throws IOException {
         if (this.producer != null) {
             this.producer.produceContent(encoder, ioctrl);
@@ -124,7 +122,7 @@ public class BasicAsyncResponseProducer 
     }
 
     @Override
-    public synchronized void close() throws IOException {
+    public void close() throws IOException {
         if (this.producer != null) {
             this.producer.close();
         }