Skip to content

Commit b1d1106

Browse files
author
zhangquanli
committed
程序清单 10-6 通过公开调用来避免在相互协作的对象之间产生死锁
1 parent e7831b0 commit b1d1106

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/chapter_10/code_06/CooperatingNoDeadlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public synchronized Point getLocation() {
2424
return location;
2525
}
2626

27-
public synchronized void setLocation(Point location) {
27+
public void setLocation(Point location) {
2828
boolean reachedDestination;
2929
synchronized (this) {
3030
this.location = location;

0 commit comments

Comments
 (0)