Search in sources :

Example 26 with RReadWriteLock

use of org.redisson.api.RReadWriteLock in project redisson by redisson.

the class RedissonReadWriteLockTest method testHoldCount.

@Test
public void testHoldCount() {
    RReadWriteLock rwlock = redisson.getReadWriteLock("lock");
    testHoldCount(rwlock.readLock());
    testHoldCount(rwlock.writeLock());
}
Also used : RReadWriteLock(org.redisson.api.RReadWriteLock) Test(org.junit.jupiter.api.Test)

Aggregations

RReadWriteLock (org.redisson.api.RReadWriteLock)26 Test (org.junit.jupiter.api.Test)25 RLock (org.redisson.api.RLock)18 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 SecureRandom (java.security.SecureRandom)3 Random (java.util.Random)3 ExecutionException (java.util.concurrent.ExecutionException)2 ExecutorService (java.util.concurrent.ExecutorService)2 TimeoutException (java.util.concurrent.TimeoutException)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 ArrayList (java.util.ArrayList)1 Callable (java.util.concurrent.Callable)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Future (java.util.concurrent.Future)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Test (org.junit.Test)1 ClusterProcesses (org.redisson.ClusterRunner.ClusterProcesses)1 RedissonClient (org.redisson.api.RedissonClient)1 Config (org.redisson.config.Config)1