Chromium Code Reviews| Index: src/platform.h |
| =================================================================== |
| --- src/platform.h (revision 6114) |
| +++ src/platform.h (working copy) |
| @@ -387,6 +387,9 @@ |
| // Create new thread. |
| Thread(); |
| +#ifdef DEBUG_THREAD_NAMES |
| + explicit Thread(const char* name); |
| +#endif |
| virtual ~Thread(); |
| // Start new thread by calling the Run() method in the new thread. |
| @@ -395,6 +398,12 @@ |
| // Wait until thread terminates. |
| void Join(); |
| +#ifdef DEBUG_THREAD_NAMES |
| + inline const char* Name() const { |
|
Søren Thygesen Gjesse
2011/01/03 07:48:34
Please use all lower-case for this type of accesso
marklam
2011/01/04 01:47:09
Done.
|
| + return name_; |
| + } |
| +#endif |
| + |
| // Abstract method for run handler. |
| virtual void Run() = 0; |
| @@ -417,8 +426,16 @@ |
| static void YieldCPU(); |
| private: |
| +#ifdef DEBUG_THREAD_NAMES |
| + void SetName(const char *name); |
|
Søren Thygesen Gjesse
2011/01/03 07:48:34
This setter should be called set_name, see http://
marklam
2011/01/04 01:47:09
Done.
|
| +#endif |
| + |
| class PlatformData; |
| PlatformData* data_; |
| +#ifdef DEBUG_THREAD_NAMES |
| + char name_[16]; |
|
Søren Thygesen Gjesse
2011/01/03 07:48:34
I think that this constant deserves a comment. E.g
marklam
2011/01/04 01:47:09
Done.
|
| +#endif |
| + |
| DISALLOW_COPY_AND_ASSIGN(Thread); |
| }; |