java.util.concurrent.locks.ReentrantReadWriteLock#hasWaiters()源码实例Demo

下面列出了java.util.concurrent.locks.ReentrantReadWriteLock#hasWaiters() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-jdk9   文件: ReentrantReadWriteLockTest.java
public void testHasWaitersNPE(boolean fair) {
    final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(fair);
    try {
        lock.hasWaiters(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码2 项目: openjdk-jdk9   文件: ReentrantReadWriteLockTest.java
public void testHasWaitersIAE(boolean fair) {
    final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(fair);
    final Condition c = lock.writeLock().newCondition();
    final ReentrantReadWriteLock lock2 = new ReentrantReadWriteLock(fair);
    try {
        lock2.hasWaiters(c);
        shouldThrow();
    } catch (IllegalArgumentException success) {}
}
 
源代码3 项目: openjdk-jdk9   文件: ReentrantReadWriteLockTest.java
public void testHasWaitersIMSE(boolean fair) {
    final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(fair);
    final Condition c = lock.writeLock().newCondition();
    try {
        lock.hasWaiters(c);
        shouldThrow();
    } catch (IllegalMonitorStateException success) {}
}
 
源代码4 项目: j2objc   文件: ReentrantReadWriteLockTest.java
public void testHasWaitersNPE(boolean fair) {
    final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(fair);
    try {
        lock.hasWaiters(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码5 项目: j2objc   文件: ReentrantReadWriteLockTest.java
public void testHasWaitersIAE(boolean fair) {
    final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(fair);
    final Condition c = lock.writeLock().newCondition();
    final ReentrantReadWriteLock lock2 = new ReentrantReadWriteLock(fair);
    try {
        lock2.hasWaiters(c);
        shouldThrow();
    } catch (IllegalArgumentException success) {}
}
 
源代码6 项目: j2objc   文件: ReentrantReadWriteLockTest.java
public void testHasWaitersIMSE(boolean fair) {
    final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(fair);
    final Condition c = lock.writeLock().newCondition();
    try {
        lock.hasWaiters(c);
        shouldThrow();
    } catch (IllegalMonitorStateException success) {}
}