Author: kkolinko
Date: Fri Jan 25 22:34:57 2013
New Revision: 1438747
URL: http://svn.apache.org/viewvc?rev=1438747&view=rev
Log:
Make the messages list synchronized as a whole, instead of just using a
volatile reference to it.
I am still observing random failures with TestWsWebSocketContainer, so an issue
is not here.
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java?rev=1438747&r1=1438746&r2=1438747&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
(original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
Fri Jan 25 22:34:57 2013
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -245,7 +246,8 @@ public class TestWsWebSocketContainer ex
private final CountDownLatch latch;
- private volatile List<T> messages = new ArrayList<>();
+ private final List<T> messages = Collections
+ .synchronizedList(new ArrayList<T>());
public TesterMessageHandler(CountDownLatch latch) {
this.latch = latch;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]