mirror of
https://github.com/fenixsoft/jvm_book.git
synced 2024-12-25 20:30:50 +08:00
Update ThreadDeadLockTestCase_2.java
This commit is contained in:
parent
145c82003c
commit
54c165d7bb
@ -8,9 +8,9 @@ public class ThreadDeadLockTestCase_2 {
|
||||
/**
|
||||
* 线程死锁等待演示
|
||||
*/
|
||||
static class SynAddRunnalbe implements Runnable {
|
||||
static class SynAddRunnable implements Runnable {
|
||||
int a, b;
|
||||
public SynAddRunnalbe(int a, int b) {
|
||||
public SynAddRunnable(int a, int b) {
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
}
|
||||
@ -27,8 +27,8 @@ public class ThreadDeadLockTestCase_2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
new Thread(new SynAddRunnalbe(1, 2)).start();
|
||||
new Thread(new SynAddRunnalbe(2, 1)).start();
|
||||
new Thread(new SynAddRunnable(1, 2)).start();
|
||||
new Thread(new SynAddRunnable(2, 1)).start();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user