Stephan van Hulst wrote:A critical section that is protected by a reentrant lock can be reentered by the same thread.
This includes entering a different critical section that is protected by the same lock:
Thank you for the explanation.
From reading it, I understand that the Reentrant Lock knows that the thread that is trying to access it again already holds it and so it will allow it to execute through the "another protected section"?
As I understand, this will not guarantee against deadlock when there are different locks - in the case where "another protected thing" was held by a different lock - please correct me if I am mistaken.