Why does the acquire() method in Semaphores not have to be synchronized?

后端 未结 3 1426
半阙折子戏
半阙折子戏 2021-01-02 23:30

I am getting into Semaphores in Java and was reading this article http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Semaphore.html . The only thing I don\'t

3条回答
  •  误落风尘
    2021-01-03 00:05

    synchronization is guaranteed by AbstractQueuedSynchronizer with CAS operations

    see the javadoc here

提交回复
热议问题