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

Unified Diff: runtime/vm/dart_api_impl.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/include/dart_tools_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 0a25473aabd089d59f48d3d6d40b86d9fbbdada3..01ed58accef6608c1cda1b02d640abeeefdc0ca4 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -5958,7 +5958,7 @@ DART_EXPORT void Dart_TimelineEvent(const char* label,
if (type < Dart_Timeline_Event_Begin) {
return;
}
- if (type > Dart_Timeline_Event_Metadata) {
+ if (type > Dart_Timeline_Event_Counter) {
return;
}
TimelineStream* stream = Timeline::GetEmbedderStream();
@@ -5992,9 +5992,6 @@ DART_EXPORT void Dart_TimelineEvent(const char* label,
case Dart_Timeline_Event_Counter:
event->Counter(label, timestamp0);
break;
- case Dart_Timeline_Event_Metadata:
- event->Metadata(label, timestamp0);
- break;
default:
FATAL("Unknown Dart_Timeline_Event_Type");
}
@@ -6006,6 +6003,16 @@ DART_EXPORT void Dart_TimelineEvent(const char* label,
}
+DART_EXPORT void Dart_SetThreadName(const char* name) {
+ OSThread* thread = OSThread::Current();
+ if (thread == NULL) {
+ // VM is shutting down.
+ return;
+ }
+ thread->SetName(name);
+}
+
+
// The precompiler is included in dart_bootstrap and dart_noopt, and
// excluded from dart and dart_precompiled_runtime.
#if !defined(DART_PRECOMPILER)
« no previous file with comments | « runtime/include/dart_tools_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698