MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / run

Method run

day24/code/day24_Thread/src/cn/itcast_02/DieLock.java:10–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 }
9
10 @Override
11 public void run() {
12 if (flag) {
13 synchronized (MyLock.objA) {
14 System.out.println("if objA"); // CPU��ִ��Ȩû����
15 synchronized (MyLock.objB) {
16 System.out.println("if objB");
17 }
18 }
19 } else {
20 synchronized (MyLock.objB) {
21 System.out.println("else objB");
22 synchronized (MyLock.objA) {
23 System.out.println("else objA");
24 }
25 }
26 }
27 }
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected