线程池无法获取到线程的名字

线程池execute线程后,用Thread.currentThread().getName() 获取不到本来的名字。
解决办法:
在线程的方法里面,用this.getName() 即可。

发布了422 篇原创文章 · 获赞 7 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/enthan809882/article/details/104243686