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

Unified Diff: src/platform.h

Issue 6070009: Added labelled thread names to help with some debugging activity. Right now,... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 12 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 | « src/log.cc ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform.h
===================================================================
--- src/platform.h (revision 6139)
+++ src/platform.h (working copy)
@@ -387,6 +387,7 @@
// Create new thread.
Thread();
+ explicit Thread(const char* name);
virtual ~Thread();
// Start new thread by calling the Run() method in the new thread.
@@ -395,6 +396,10 @@
// Wait until thread terminates.
void Join();
+ inline const char* name() const {
+ return name_;
+ }
+
// Abstract method for run handler.
virtual void Run() = 0;
@@ -417,8 +422,16 @@
static void YieldCPU();
private:
+ void set_name(const char *name);
+
class PlatformData;
PlatformData* data_;
+
+ // The thread name length is limited to 16 based on Linux's implementation of
+ // prctl().
+ static const int kMaxThreadNameLength = 16;
+ char name_[kMaxThreadNameLength];
+
DISALLOW_COPY_AND_ASSIGN(Thread);
};
« no previous file with comments | « src/log.cc ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698