summaryrefslogtreecommitdiffstats
path: root/base/platform_thread_win.cc
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-02 15:10:46 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-02 15:10:46 +0000
commit5f945e0f45394453602083b22206acb4cde3db4f (patch)
tree42c1404d76002893cea967a24792dc898c89d185 /base/platform_thread_win.cc
parent6240776617651b092c498411c696be9ae45a0178 (diff)
downloadchromium_src-5f945e0f45394453602083b22206acb4cde3db4f.zip
chromium_src-5f945e0f45394453602083b22206acb4cde3db4f.tar.gz
chromium_src-5f945e0f45394453602083b22206acb4cde3db4f.tar.bz2
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
Diffstat (limited to 'base/platform_thread_win.cc')
-rw-r--r--base/platform_thread_win.cc5
1 files changed, 5 insertions, 0 deletions
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;