Index: src/platform-freebsd.cc |
=================================================================== |
--- src/platform-freebsd.cc (revision 6139) |
+++ src/platform-freebsd.cc (working copy) |
@@ -411,9 +411,15 @@ |
Thread::Thread() : ThreadHandle(ThreadHandle::INVALID) { |
+ set_name("v8:<unknown>"); |
} |
+Thread::Thread(const char* name) : ThreadHandle(ThreadHandle::INVALID) { |
+ set_names(name); |
+} |
+ |
+ |
Thread::~Thread() { |
} |
@@ -430,6 +436,12 @@ |
} |
+void Thread::set_name(const char* name) { |
+ strncpy(name_, name, sizeof(name_)); |
+ name_[sizeof(name_) - 1] = '\0'; |
+} |
+ |
+ |
void Thread::Start() { |
pthread_create(&thread_handle_data()->thread_, NULL, ThreadEntry, this); |
ASSERT(IsValid()); |