|
|
@ -1,16 +1,29 @@
|
|
|
|
package org.redisson;
|
|
|
|
package org.redisson;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
import org.junit.After;
|
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Assert;
|
|
|
|
import org.junit.Assert;
|
|
|
|
|
|
|
|
import org.junit.Before;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.redisson.core.RCountDownLatch;
|
|
|
|
import org.redisson.core.RCountDownLatch;
|
|
|
|
|
|
|
|
|
|
|
|
public class RedissonCountDownLatchConcurrentTest {
|
|
|
|
public class RedissonCountDownLatchConcurrentTest {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
|
|
|
|
public void before() throws IOException, InterruptedException {
|
|
|
|
|
|
|
|
RedisRunner.startDefaultRedisTestInstance();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@After
|
|
|
|
|
|
|
|
public void after() throws InterruptedException {
|
|
|
|
|
|
|
|
RedisRunner.shutDownDefaultRedisTestInstance();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testSingleCountDownAwait_SingleInstance() throws InterruptedException {
|
|
|
|
public void testSingleCountDownAwait_SingleInstance() throws InterruptedException {
|
|
|
|
final int iterations = Runtime.getRuntime().availableProcessors()*3;
|
|
|
|
final int iterations = Runtime.getRuntime().availableProcessors()*3;
|
|
|
|