Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
fix: correct volatile description for AQS state variable (issue #2516) (#2829)
The previous description only mentioned thread visibility as the reason for using volatile to modify the state variable. However, volatile's more important role here is preventing instruction reordering through the happens-before rule (volatile write happens-before subsequent read), which ensures the correctness of lock semantics. Fixes #2516
S
Senrian committed
b7b3f1a25ab61ab63f5fd7bb27c8bddda55606d6
Parent: 38f77e3
Committed by GitHub <noreply@github.com>
on 4/15/2026, 2:53:01 AM