Skip to content
New issue

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

4.3.1 Demo线程状态疑惑 #138

Open
whatoeat2night opened this issue Apr 8, 2023 · 0 comments
Open

4.3.1 Demo线程状态疑惑 #138

whatoeat2night opened this issue Apr 8, 2023 · 0 comments

Comments

@whatoeat2night
Copy link

章节
请描述详细的章节
Screenshot 2023-04-08 at 10 54 49

相关截图或文字
请描述相关的截图或文字

疑问
请描述修正意见,如果可以,请直接提PR,谢谢~

Thread a 从 TIMED_WAITING 转换到 RUNNABLE 之后,并不需要去争抢锁资源,因为Thread.sleep(2000) 并不会去释放锁资源,Thread a 应该继续执行后续代码,为什么这里会从 RUNNABLE 转换到 BLOCKED 状态呢? 很奇怪?
Thread b 在执行的时候,Thread a 没有释放锁,Thread b 应该就直接terminated 了,后面没有人想去尝试争夺 锁 资源,为什么Thread a会变成 BLOCKED状态,实在是不李姐呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant