Add support for setting thread names on Windows
JavaScriptCore:
Add support for setting thread names on Windows
These thread names make it much easier to identify particular threads
in Visual Studio's Threads panel.
WTF::createThread now takes a const char* representing the thread's
name. On Windows, we throw a special exception to set this string as
the thread's name. Other platforms do nothing with this name for now.
Reviewed by Anders Carlsson.
- JavaScriptCore.exp: Export the new version of createThread that
takes 3 arguments (the old one continues to be exported for backward
compatibility).
- wtf/Threading.h: Add a threadName argument to createThread.
- wtf/ThreadingGtk.cpp:
(WTF::createThread):
- wtf/ThreadingNone.cpp:
(WTF::createThread):
Updated for function signature change.
- wtf/ThreadingPthreads.cpp:
(WTF::createThread): Updated for function signature change. We keep
around the old 2-argument version of createThread for backward
compatibility.
- wtf/ThreadingWin.cpp:
(WTF::setThreadName): Added. This function's implementation came from
MSDN.
(WTF::initializeThreading): Set the name of the main thread.
(WTF::createThread): Call setThreadName. We keep around the old
2-argument version of createThread for backward compatibility.
WebCore:
Add names for WebCore's threads
Reviewed by Anders Carlsson.
- loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::open):
- storage/DatabaseThread.cpp:
(WebCore::DatabaseThread::start):
- storage/LocalStorageThread.cpp:
(WebCore::LocalStorageThread::start):
Pass in names to createThread.
- platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::runLoaderThread):
(WebCore::ResourceHandle::loaderRunLoop):
Changed to use WTF::createThread.
WebKit/win:
Export the new version of createThread
Reviewed by Anders Carlsson.
- WebKit.vcproj/WebKit.def:
- WebKit.vcproj/WebKit_debug.def:
Also moved the old version of createThread into the deprecated
section.