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

Side by Side Diff: runtime/vm/os_thread.h

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 unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/os_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_OS_THREAD_H_ 5 #ifndef VM_OS_THREAD_H_
6 #define VM_OS_THREAD_H_ 6 #define VM_OS_THREAD_H_
7 7
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 ThreadId trace_id() const { 69 ThreadId trace_id() const {
70 ASSERT(trace_id_ != OSThread::kInvalidThreadJoinId); 70 ASSERT(trace_id_ != OSThread::kInvalidThreadJoinId);
71 return trace_id_; 71 return trace_id_;
72 } 72 }
73 73
74 const char* name() const { 74 const char* name() const {
75 return name_; 75 return name_;
76 } 76 }
77 77
78 void SetName(const char* name);
79
78 void set_name(const char* name) { 80 void set_name(const char* name) {
79 ASSERT(OSThread::Current() == this); 81 ASSERT(OSThread::Current() == this);
80 ASSERT(name_ == NULL); 82 ASSERT(name_ == NULL);
81 ASSERT(name != NULL); 83 ASSERT(name != NULL);
82 name_ = strdup(name); 84 name_ = strdup(name);
83 } 85 }
84 86
85 Mutex* timeline_block_lock() const { 87 Mutex* timeline_block_lock() const {
86 return timeline_block_lock_; 88 return timeline_block_lock_;
87 } 89 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 friend class SafepointMonitorLocker; 345 friend class SafepointMonitorLocker;
344 friend void Dart_TestMonitor(); 346 friend void Dart_TestMonitor();
345 DISALLOW_COPY_AND_ASSIGN(Monitor); 347 DISALLOW_COPY_AND_ASSIGN(Monitor);
346 }; 348 };
347 349
348 350
349 } // namespace dart 351 } // namespace dart
350 352
351 353
352 #endif // VM_OS_THREAD_H_ 354 #endif // VM_OS_THREAD_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/os_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698