You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2004/02/13 02:22:16 UTC

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/samplers RemoteListenerWrapper.java

sebb        2004/02/12 17:22:16

  Modified:    src/core/org/apache/jmeter/samplers
                        RemoteListenerWrapper.java
  Log:
  ASF L V2; synch access
  
  Revision  Changes    Path
  1.11      +29 -6     jakarta-jmeter/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java
  
  Index: RemoteListenerWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- RemoteListenerWrapper.java	7 Jan 2004 00:36:31 -0000	1.10
  +++ RemoteListenerWrapper.java	13 Feb 2004 01:22:16 -0000	1.11
  @@ -1,3 +1,21 @@
  +// $Header$
  +/*
  + * Copyright 2001-2004 The Apache Software Foundation.
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *   http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + * 
  +*/
  +
   package org.apache.jmeter.samplers;
   
   import java.io.Serializable;
  @@ -70,10 +88,12 @@
           try
           {
           	if (holdSamples){
  -				Iterator i = sampleStore.iterator();
  -				while (i.hasNext()) {
  -				  SampleEvent se = (SampleEvent) i.next();
  -				  listener.sampleOccurred(se);
  +        	    synchronized(sampleStore){
  +					Iterator i = sampleStore.iterator();
  +					while (i.hasNext()) {
  +					  SampleEvent se = (SampleEvent) i.next();
  +					  listener.sampleOccurred(se);
  +					}
   				}
           	}
               listener.testEnded();
  @@ -124,7 +144,10 @@
           try
           {
             if (holdSamples) {
  -            sampleStore.add(e);
  +          	synchronized(sampleStore)
  +            {
  +            	sampleStore.add(e);
  +            }
             } else { 
               listener.sampleOccurred(e);
             }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org