While going through the advantages of ReEntrantLock
one of them is:
With ReentrantLock, a thread can acquire lock on the same object more than once.
I came across this answer which states that there would be a deadlock in the get(index)
. Can someone please explain how can a deadlock occur at that point, if we are not using any synchronization
on get(index)
?