質問編集履歴
1
コードの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,13 +14,13 @@
|
|
14
14
|
synchronized(this){
|
15
15
|
System.out.println("Transferring "+amount+" from "+name);
|
16
16
|
Thread.sleep(100);
|
17
|
-
|
17
|
+
synchronized(other){
|
18
18
|
if(amount>value) System.out.println("Not enough money");
|
19
19
|
else{
|
20
20
|
other.value=other.value+amount;
|
21
21
|
this.value-=amount;
|
22
22
|
}
|
23
|
-
|
23
|
+
}
|
24
24
|
}
|
25
25
|
}
|
26
26
|
}
|