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

Update 多线程通信的三大法器,你真的会用吗?.md #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update 多线程通信的三大法器,你真的会用吗?.md
  • Loading branch information
piccasi authored Sep 24, 2022
commit 227904d780f348f3a21ec5c8c67ea0028d247136
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ wait:让持有该对象锁的线程等待;

notify: 唤醒任何一个持有该对象锁的线程;

notify: 唤醒所有持有该对象锁的线程;
notifyAll: 唤醒所有持有该对象锁的线程;

它们 3 个的关系是,调用对象的 wait 方法使线程暂停运行,通过 notify/ notifyAll 方法唤醒调用 wait 暂时的线程。

Expand Down Expand Up @@ -74,4 +74,4 @@ public static void main(String[] args) {

更多 Java 多线程技术文章请在后台回复:多线程。

> 本文原创首发于微信公众号:Java技术栈(id:javastack),关注公众号在后台回复 "java" 可获取更多,转载请原样保留本信息。
> 本文原创首发于微信公众号:Java技术栈(id:javastack),关注公众号在后台回复 "java" 可获取更多,转载请原样保留本信息。