Index: src/platform-openbsd.cc |
=================================================================== |
--- src/platform-openbsd.cc (revision 6139) |
+++ src/platform-openbsd.cc (working copy) |
@@ -387,9 +387,15 @@ |
Thread::Thread() : ThreadHandle(ThreadHandle::INVALID) { |
+ set_name("v8:<unknown>"); |
} |
+Thread::Thread(const char* name) : ThreadHandle(ThreadHandle::INVALID) { |
+ set_name(name); |
+} |
+ |
+ |
Thread::~Thread() { |
} |
@@ -406,6 +412,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()); |