mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
修改避免死锁为预防死锁
This commit is contained in:
parent
3f0e3dbd67
commit
b61b1f694a
@ -340,7 +340,7 @@ Thread[线程 2,5,main]waiting get resource1
|
||||
1. 不剥夺条件:线程已获得的资源在末使用完之前不能被其他线程强行剥夺,只有自己使用完毕后才释放资源。
|
||||
1. 循环等待条件:若干进程之间形成一种头尾相接的循环等待资源关系。
|
||||
|
||||
### 如何避免线程死锁?
|
||||
### 如何预防线程死锁?
|
||||
|
||||
我们只要破坏产生死锁的四个条件中的其中一个就可以了。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user