0

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:
deanm@chromium.org
2008-10-02 15:10:46 +00:00
parent 6240776617
commit 5f945e0f45

@ -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;