What does intrinsic lock actually mean for a Java class?

前端 未结 7 1521
逝去的感伤
逝去的感伤 2021-02-04 10:50

In order to properly understand the issues and solutions for concurrency in Java, I was going through the official Java tutorial. In one of the pages they defined Intrin

相关标签:
7条回答
  • 2021-02-04 11:31

    Locks can be divided in two classes - 'reentrant' and 'not reentrant'. In Java 'synchronized', base implementation of interface Lock (class ReentrantLock), interface ReadWriteLock (class ReentrantReadWriteLock) - are reentrant. Reentrancy means - one thread can again and again hold the lock.

    0 讨论(0)
提交回复
热议问题