From 5f945e0f45394453602083b22206acb4cde3db4f Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Thu, 2 Oct 2008 15:10:46 +0000 Subject: 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 --- base/platform_thread_win.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'base/platform_thread_win.cc') diff --git a/base/platform_thread_win.cc b/base/platform_thread_win.cc index 00efdc1..f477ff0 100644 --- a/base/platform_thread_win.cc +++ b/base/platform_thread_win.cc @@ -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; -- cgit v1.1