Example usage for java.util.concurrent.locks ReentrantLock hasQueuedThreads

List of usage examples for java.util.concurrent.locks ReentrantLock hasQueuedThreads

Introduction

In this page you can find the example usage for java.util.concurrent.locks ReentrantLock hasQueuedThreads.

Prototype

public final boolean hasQueuedThreads() 

Source Link

Document

Queries whether any threads are waiting to acquire this lock.

Usage

From source file:Main.java

private static String getLockInfo(ReentrantLock lock) {
    String lockid = "Lock@" + Integer.toHexString(lock.hashCode());
    return "lock " + lockid + " held=" + lock.getHoldCount() + " isHeldMe=" + lock.isHeldByCurrentThread()
            + " hasQueueThreads=" + lock.hasQueuedThreads();
}