We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
图17-2 :https://bugstack.cn/assets/images/2020/interview/interview-17-2.png 1、nonfairTryAcquire根据源码应该是一个逻辑分支 final boolean nonfairTryAcquire(int acquires) 返回true和false两种情况,应该是一一个“菱形”选择分支。 2、nonfairTryAcquire其中有个子流程 (如果state=0 则cas修改 设置独占线程并返回true,如果state!=0 则判断是否当前线程重入? 是的话State+1 返回true,其他情况均为false) 3、cas修改共享变量是否成功 并不是 进入current == getExclusiveOwnerThread() 的判断条件,且修改成功后 说明获得了锁 与流程图中不符。
欢迎各位一起交流指导:v信:JinLS1216 周大拿
The text was updated successfully, but these errors were encountered:
No branches or pull requests
图17-2 :https://bugstack.cn/assets/images/2020/interview/interview-17-2.png
1、nonfairTryAcquire根据源码应该是一个逻辑分支 final boolean nonfairTryAcquire(int acquires) 返回true和false两种情况,应该是一一个“菱形”选择分支。
2、nonfairTryAcquire其中有个子流程 (如果state=0 则cas修改 设置独占线程并返回true,如果state!=0 则判断是否当前线程重入? 是的话State+1 返回true,其他情况均为false)
3、cas修改共享变量是否成功 并不是 进入current == getExclusiveOwnerThread() 的判断条件,且修改成功后 说明获得了锁 与流程图中不符。
欢迎各位一起交流指导:v信:JinLS1216 周大拿
The text was updated successfully, but these errors were encountered: