Skip to content
Permalink
Browse files
problem with sync method, use atomic integer
  • Loading branch information
shawnmckinney committed Sep 21, 2020
1 parent f72ed09 commit 923d8a4acc0fe231da01516821052e07f7f8d9b8
Showing 1 changed file with 6 additions and 3 deletions.
@@ -34,6 +34,7 @@
import java.io.PrintWriter;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.atomic.AtomicInteger;

import static org.junit.Assert.assertNotNull;

@@ -47,7 +48,8 @@ public abstract class UserBase extends AbstractJavaSamplerClient
protected AdminMgr adminMgr;
protected ReviewMgr reviewMgr;
protected static final Logger LOG = LoggerFactory.getLogger( UserBase.class );
private static int count = 0;
//private static int count = 0;
private static AtomicInteger count = new AtomicInteger(0);
protected String hostname;
protected String qualifier;
private String filename;
@@ -137,9 +139,10 @@ protected void warn( String message )
*
* @return
*/
synchronized int getKey( )
protected int getKey( )
{
return ++count;
//return ++count;
return count.incrementAndGet();
}

String getThreadId()

0 comments on commit 923d8a4

Please sign in to comment.