| Index: src/platform.h
|
| ===================================================================
|
| --- src/platform.h (revision 6941)
|
| +++ src/platform.h (working copy)
|
| @@ -387,6 +387,7 @@
|
|
|
| // Create new thread (with a value for storing in the TLS isolate field).
|
| explicit Thread(Isolate* isolate);
|
| + Thread(Isolate* isolate, 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;
|
|
|
| @@ -418,10 +423,17 @@
|
|
|
| Isolate* isolate() const { return isolate_; }
|
|
|
| + // The thread name length is limited to 16 based on Linux's implementation of
|
| + // prctl().
|
| + static const int kMaxThreadNameLength = 16;
|
| private:
|
| + void set_name(const char *name);
|
| +
|
| class PlatformData;
|
| PlatformData* data_;
|
| Isolate* isolate_;
|
| + char name_[kMaxThreadNameLength];
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(Thread);
|
| };
|
|
|
|
|