Skip to content

Commit

Permalink
misspelled: IllegalMonitorStateExeception TO IllegalMonitorStateExcep…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
PansonPanson committed Dec 2, 2018
1 parent c631ea7 commit 5cf8bc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion notes/Java 并发.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ B

它们都属于 Object 的一部分,而不属于 Thread。

只能用在同步方法或者同步控制块中使用,否则会在运行时抛出 IllegalMonitorStateExeception
只能用在同步方法或者同步控制块中使用,否则会在运行时抛出 IllegalMonitorStateException

使用 wait() 挂起期间,线程会释放锁。这是因为,如果没有释放锁,那么其它线程就无法进入对象的同步方法或者同步控制块中,那么就无法执行 notify() 或者 notifyAll() 来唤醒挂起的线程,造成死锁。

Expand Down

0 comments on commit 5cf8bc1

Please sign in to comment.