Don't throw the thread name setting exception unless a debugger is attached.
Review URL: http://codereview.chromium.org/5671 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2792 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -48,6 +48,11 @@ void PlatformThread::Sleep(int duration_ms) {
|
||||
|
||||
// static
|
||||
void PlatformThread::SetName(const char* name) {
|
||||
// The debugger needs to be around to catch the name in the exception. If
|
||||
// there isn't a debugger, we are just needlessly throwing an exception.
|
||||
if (!::IsDebuggerPresent())
|
||||
return;
|
||||
|
||||
THREADNAME_INFO info;
|
||||
info.dwType = 0x1000;
|
||||
info.szName = name;
|
||||
|
Reference in New Issue
Block a user