Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: runtime/vm/os_thread.cc

Issue 1851953002: Add API to set thread name (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/os_thread.h ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « runtime/vm/os_thread.h ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698