From d5aa3eae894170930db6114236334b9f5b3cfbf4 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Fri, 20 Mar 2009 12:49:08 +0000 Subject: [PATCH] Document thread-safety git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@756435 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/impl/conn/tsccm/WaitingThread.java | 2 ++ .../http/impl/conn/tsccm/WaitingThreadAborter.java | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java index 1c15984d2..d11bee8cd 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java @@ -34,6 +34,7 @@ package org.apache.http.impl.conn.tsccm; import java.util.Date; import java.util.concurrent.locks.Condition; +import net.jcip.annotations.NotThreadSafe; /** * Represents a thread waiting for a connection. @@ -48,6 +49,7 @@ import java.util.concurrent.locks.Condition; * * @since 4.0 */ +@NotThreadSafe public class WaitingThread { /** The condition on which the thread is waiting. */ diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java index a557d08ba..311f398cf 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java @@ -30,11 +30,17 @@ package org.apache.http.impl.conn.tsccm; -/** A simple class that can interrupt a {@link WaitingThread}. */ -/** - * +import net.jcip.annotations.NotThreadSafe; + +// TODO - only called from ConnPoolByRoute currently; consider adding it as nested class +/** + * A simple class that can interrupt a {@link WaitingThread}. + * + * Must be called with the pool lock held. + * * @since 4.0 */ +@NotThreadSafe public class WaitingThreadAborter { private WaitingThread waitingThread;