Changeset 41626 in webkit
- Timestamp:
- Mar 12, 2009, 8:01:46 AM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r41613 r41626 1 2009-03-12 Adam Roben <[email protected]> 2 3 Adopt setThreadNameInternal on Windows 4 5 Also changed a Windows-only assertion about thread name length to an 6 all-platform log message. 7 8 Reviewed by Adam Treat. 9 10 * wtf/Threading.cpp: 11 (WTF::createThread): Warn if the thread name is longer than 31 12 characters, as Visual Studio will truncate names longer than that 13 length. 14 15 * wtf/ThreadingWin.cpp: 16 (WTF::setThreadNameInternal): Renamed from setThreadName and changed 17 to always operate on the current thread. 18 (WTF::initializeThreading): Changed to use setThreadNameInternal. 19 (WTF::createThreadInternal): Removed call to setThreadName. This is 20 now handled by threadEntryPoint and setThreadNameInternal. 21 1 22 2009-03-11 David Kilzer <[email protected]> 2 23 -
trunk/JavaScriptCore/wtf/Threading.cpp
r41605 r41626 65 65 ThreadIdentifier createThread(ThreadFunction entryPoint, void* data, const char* name) 66 66 { 67 // Visual Studio has a 31-character limit on thread names. Longer names will 68 // be truncated silently, but we'd like callers to know about the limit. 69 #if !LOG_DISABLED 70 if (strlen(name) > 31) 71 LOG_ERROR("Thread name \"%s\" is longer than 31 characters and will be truncated by Visual Studio", name); 72 #endif 73 67 74 NewThreadContext* context = new NewThreadContext(entryPoint, data, name); 68 75 -
trunk/JavaScriptCore/wtf/ThreadingWin.cpp
r41605 r41626 99 99 namespace WTF { 100 100 101 // MS_VC_EXCEPTION, THREADNAME_INFO, and setThreadName all come from <http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx>.101 // MS_VC_EXCEPTION, THREADNAME_INFO, and setThreadNameInternal all come from <http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx>. 102 102 static const DWORD MS_VC_EXCEPTION = 0x406D1388; 103 103 … … 111 111 #pragma pack(pop) 112 112 113 static void setThreadName(DWORD dwThreadID, LPCSTR szThreadName) 114 { 115 // Visual Studio has a 31-character limit on thread names. Longer names will 116 // be truncated silently, but we'd like callers to know about the limit. 117 ASSERT_ARG(szThreadName, strlen(szThreadName) <= 31); 118 113 void setThreadNameInternal(const char* szThreadName) 114 { 119 115 THREADNAME_INFO info; 120 116 info.dwType = 0x1000; 121 117 info.szName = szThreadName; 122 info.dwThreadID = dwThreadID;118 info.dwThreadID = GetCurrentThreadId(); 123 119 info.dwFlags = 0; 124 120 … … 158 154 initializeMainThread(); 159 155 mainThreadIdentifier = currentThread(); 160 setThreadName (mainThreadIdentifier,"Main Thread");156 setThreadNameInternal("Main Thread"); 161 157 } 162 158 } … … 221 217 } 222 218 223 if (threadName)224 setThreadName(threadIdentifier, threadName);225 226 219 threadID = static_cast<ThreadIdentifier>(threadIdentifier); 227 220 storeThreadHandleByIdentifier(threadIdentifier, threadHandle); 228 221 229 222 return threadID; 230 }231 232 void setThreadNameInternal(const char*)233 {234 223 } 235 224
Note:
See TracChangeset
for help on using the changeset viewer.