I have Condition variable named cond.
Is there any method which could give me true or false if there is any thread awaiting on cond?
I need something like: Boolean cond.isAwaitingSetEmpty()
Thanks for help
I have Condition variable named cond.
Is there any method which could give me true or false if there is any thread awaiting on cond?
I need something like: Boolean cond.isAwaitingSetEmpty()
Thanks for help
If by "condition" you mean a
Condition
created byReentrantLock.newCondition()
, then you can useReentrantLock.hasWaiters(Condition cond)
.It's available from the
Lock
that theCondition
is bound to:http://download.oracle.com/javase/6/docs/api/java/util/concurrent/locks/ReentrantLock.html
For example:
etc.