修改getId为threadId。
This commit is contained in:
parent
12ad1d5a4b
commit
2e97a395c4
@ -22,6 +22,6 @@ public class App
|
|||||||
workThread.start();
|
workThread.start();
|
||||||
jobThread.start();
|
jobThread.start();
|
||||||
|
|
||||||
System.out.println( "我是主线程!" + String.valueOf(Thread.currentThread().getId()) );
|
System.out.println( "我是主线程!" + String.valueOf( Thread.currentThread().threadId() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,6 @@ public class MyThread extends Thread
|
|||||||
{
|
{
|
||||||
super.run();
|
super.run();
|
||||||
|
|
||||||
System.out.println("我是工作线程:" + String.valueOf(Thread.currentThread().getId()) );
|
System.out.println("我是工作线程:" + String.valueOf(Thread.currentThread().threadId()) );
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -15,6 +15,6 @@ public class MyWorkingJob implements Runnable
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
System.out.println("我是workingJob,ID是" + String.valueOf( Thread.currentThread().getId()));
|
System.out.println("我是workingJob,ID是" + String.valueOf( Thread.currentThread().threadId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user