Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshuyangzhou2016-06-29 23:07:06 +0000
committershuyangzhou2016-06-29 23:09:30 +0000
commitf2c57904cdba0dea26889cc38cabdd4f420439dd (patch)
tree9e6bad2c1df483a68c46684c29bd81956ab42085
parentaab7a09e8a53ff70def13832a7ba6444db54a47b (diff)
downloadrt.equinox.bundles-f2c57904cdba0dea26889cc38cabdd4f420439dd.tar.gz
rt.equinox.bundles-f2c57904cdba0dea26889cc38cabdd4f420439dd.tar.xz
rt.equinox.bundles-f2c57904cdba0dea26889cc38cabdd4f420439dd.zip
LPS-66911 Only the concurrent adding needs to be protected, the reading is fine. HttpSession is thread safe to ensure attributes' memory visibility, no need to sync on read.
Signed-off-by: shuyangzhou <shuyang.zhou@liferay.com>
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpSessionAdaptor.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpSessionAdaptor.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpSessionAdaptor.java
index 27a5a98df..e2f964357 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpSessionAdaptor.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/HttpSessionAdaptor.java
@@ -92,11 +92,8 @@ public class HttpSessionAdaptor implements HttpSession, Serializable {
static void removeHttpSessionAdaptor(HttpSessionAdaptor innerSession) {
HttpSession httpSession = innerSession.getSession();
- ParentSessionListener parentListener;
- // need to have a global lock here because we must ensure that this is added only once
- synchronized (httpSession) {
- parentListener = (ParentSessionListener) httpSession.getAttribute(PARENT_SESSION_LISTENER_KEY);
- }
+ ParentSessionListener parentListener = (ParentSessionListener) httpSession.getAttribute(PARENT_SESSION_LISTENER_KEY);
+
if (parentListener != null) {
parentListener.innerSessions.remove(innerSession);
}

Back to the top