Index: src/platform-win32.cc |
=================================================================== |
--- src/platform-win32.cc (revision 6139) |
+++ src/platform-win32.cc (working copy) |
@@ -1463,9 +1463,22 @@ |
Thread::Thread() : ThreadHandle(ThreadHandle::INVALID) { |
data_ = new PlatformData(kNoThread); |
+ set_name("v8:<unknown>"); |
} |
+Thread::Thread(const char* name) : ThreadHandle(ThreadHandle::INVALID) { |
+ data_ = new PlatformData(kNoThread); |
+ set_name(name); |
+} |
+ |
+ |
+void Thread::set_name(const char* name) { |
+ strncpy(name_, name, sizeof(name_)); |
+ name_[sizeof(name_) - 1] = '\0'; |
+} |
+ |
+ |
// Close our own handle for the thread. |
Thread::~Thread() { |
if (data_->thread_ != kNoThread) CloseHandle(data_->thread_); |