如何更改线程的名称 [英] How to change the name of a thread

查看:404
本文介绍了如何更改线程的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用很多线程的服务器应用程序。不想进入一个关于它真正应该使用的线程数的参数,在调试程序threads窗口中可以看到一些描述性的文本,描述每个是什么,而不必点击到它,这将是很好的。从上下文确定它是什么。

I have a server application that uses "a lot" of threads. Without wanting to get into an argument about how many threads it really should be using, it would be nice to be able to see some descriptive text in the debugger "threads" window describing what each one is, without having to click through to it and determine from the context what it is.

它们都有相同的开始地址,所以通常线程窗口说的像thread_base :: start或类似的东西。我想知道是否有API调用或允许我自定义该文本。

They all have the same start address so generally the threads window says something like "thread_base::start" or something similar. I'd like to know if there is an API call or something that allows me to customise that text.

推荐答案

使用 SetThreadName

这篇关于如何更改线程的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆