例如,我希望图像上名为Thread-11的线程被命名为“MyImportThread”.
example-threads http://s12.postimage.org/3pq9frjct/threadname.png
解决方法:
线程foo =新线程(“Foo”);
…或通过调用Thread #setName:
public final void setName (String threadName)
设置Thread的名称.
as thread.setName(“Thread-11”);或者像Thread.currentThread().setName(“Thread-11”);