We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09304e0 commit d2e4136Copy full SHA for d2e4136
1 file changed
java_test/src/main/java/com/yiyun/ThreadThisEscape.java
@@ -0,0 +1,28 @@
1
+package com.yiyun;
2
+
3
+public class ThreadThisEscape {
4
+ private int weight=0;
5
+ public ThreadThisEscape(){
6
+ new Thread(new EscapeRunnable()).start();
7
+ weight=1;
8
+ // 模拟构造函数耗时
9
+ for (int i = 0; i < 1000000; i++)
10
+ {
11
12
+ }
13
14
15
+ private class EscapeRunnable implements Runnable
16
17
+ @Override
18
+ public void run()
19
20
+ System.out.println(ThreadThisEscape.this.weight);
21
22
23
24
+ public static void main(String[] args) {
25
+ new ThreadThisEscape();
26
27
28
+}
0 commit comments