Index: runtime/vm/os_thread.cc |
diff --git a/runtime/vm/os_thread.cc b/runtime/vm/os_thread.cc |
index b381692c08fc8b889c30ac0a4970d85170ba18a2..947b7f6955f318d3eef1b39aec80ad2285a38e4f 100644 |
--- a/runtime/vm/os_thread.cc |
+++ b/runtime/vm/os_thread.cc |
@@ -63,6 +63,18 @@ OSThread::~OSThread() { |
} |
+ |
+void OSThread::SetName(const char* name) { |
+ MutexLocker ml(thread_list_lock_); |
+ // Clear the old thread name. |
+ if (name_ != NULL) { |
+ free(name_); |
+ name_ = NULL; |
+ } |
+ set_name(name); |
+} |
+ |
+ |
void OSThread::DisableThreadInterrupts() { |
ASSERT(OSThread::Current() == this); |
AtomicOperations::FetchAndIncrement(&thread_interrupt_disabled_); |