What Happens If a Thread Can't Get the Lock in java?
What Happens If a Thread Can't Get the Lock in java?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhijeet SinghPosted Mar 28, 2014, 1:51 PM
VulpesPosted Mar 24, 2014, 9:55 AM
However, you can use the tryLock() method which does not wait if the lock is unavailable. Instead it returns true if the lock is acquired (and proceeds accordingly) or false otherwise.