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

Unified Diff: runtime/vm/os_thread.h

Issue 1475863002: Copy the passed in name string into the os_thread structure and delete it in the destructor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | runtime/vm/os_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_thread.h
diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h
index f01c4a2685c40a91d6e02e779760b215dd4c1554..9dbe50bd647208799aeec9318e2f8067a0de57b1 100644
--- a/runtime/vm/os_thread.h
+++ b/runtime/vm/os_thread.h
@@ -75,7 +75,8 @@ class OSThread : public BaseThread {
void set_name(const char* name) {
ASSERT(OSThread::Current() == this);
ASSERT(name_ == NULL);
- name_ = name;
+ ASSERT(name != NULL);
+ name_ = strdup(name);
}
Mutex* timeline_block_lock() const {
@@ -202,7 +203,7 @@ class OSThread : public BaseThread {
const ThreadId id_;
const ThreadId join_id_;
const ThreadId trace_id_; // Used to interface with tracing tools.
- const char* name_; // A name for this thread.
+ char* name_; // A name for this thread.
Mutex* timeline_block_lock_;
TimelineEventBlock* timeline_block_;
« no previous file with comments | « no previous file | runtime/vm/os_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698