java.util.concurrent.locks.ReentrantLock#getWaitQueueLength()源码实例Demo

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

源代码1 项目: openjdk-jdk9   文件: ReentrantLockTest.java
public void testGetWaitQueueLengthNPE(boolean fair) {
    final ReentrantLock lock = new ReentrantLock(fair);
    try {
        lock.getWaitQueueLength(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码2 项目: openjdk-jdk9   文件: ReentrantLockTest.java
public void testGetWaitQueueLengthIAE(boolean fair) {
    final ReentrantLock lock = new ReentrantLock(fair);
    final Condition c = lock.newCondition();
    final ReentrantLock lock2 = new ReentrantLock(fair);
    try {
        lock2.getWaitQueueLength(c);
        shouldThrow();
    } catch (IllegalArgumentException success) {}
}
 
源代码3 项目: openjdk-jdk9   文件: ReentrantLockTest.java
public void testGetWaitQueueLengthIMSE(boolean fair) {
    final ReentrantLock lock = new ReentrantLock(fair);
    final Condition c = lock.newCondition();
    try {
        lock.getWaitQueueLength(c);
        shouldThrow();
    } catch (IllegalMonitorStateException success) {}
}
 
源代码4 项目: j2objc   文件: ReentrantLockTest.java
public void testGetWaitQueueLengthNPE(boolean fair) {
    final ReentrantLock lock = new ReentrantLock(fair);
    try {
        lock.getWaitQueueLength(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码5 项目: j2objc   文件: ReentrantLockTest.java
public void testGetWaitQueueLengthIAE(boolean fair) {
    final ReentrantLock lock = new ReentrantLock(fair);
    final Condition c = lock.newCondition();
    final ReentrantLock lock2 = new ReentrantLock(fair);
    try {
        lock2.getWaitQueueLength(c);
        shouldThrow();
    } catch (IllegalArgumentException success) {}
}
 
源代码6 项目: j2objc   文件: ReentrantLockTest.java
public void testGetWaitQueueLengthIMSE(boolean fair) {
    final ReentrantLock lock = new ReentrantLock(fair);
    final Condition c = lock.newCondition();
    try {
        lock.getWaitQueueLength(c);
        shouldThrow();
    } catch (IllegalMonitorStateException success) {}
}