diff options
Diffstat (limited to 'base/threading/platform_thread.h')
-rw-r--r-- | base/threading/platform_thread.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h index 2874314..f90a9a2 100644 --- a/base/threading/platform_thread.h +++ b/base/threading/platform_thread.h @@ -111,7 +111,7 @@ class PlatformThreadHandle { const PlatformThreadId kInvalidThreadId(0); // Valid values for SetThreadPriority() -enum ThreadPriority{ +enum ThreadPriority { kThreadPriority_Normal, // Suitable for low-latency, glitch-resistant audio. kThreadPriority_RealtimeAudio, @@ -141,7 +141,10 @@ class BASE_EXPORT PlatformThread { // we're on the right thread quickly. static PlatformThreadRef CurrentRef(); - // Get the current handle. + // Get the handle representing the current thread. On Windows, this is a + // pseudo handle constant which will always represent the thread using it and + // hence should not be shared with other threads nor be used to differentiate + // the current thread from another. static PlatformThreadHandle CurrentHandle(); // Yield the current thread so another thread can be scheduled. @@ -171,9 +174,7 @@ class BASE_EXPORT PlatformThread { // CreateWithPriority() does the same thing as Create() except the priority of // the thread is set based on |priority|. Can be used in place of Create() - // followed by SetThreadPriority(). SetThreadPriority() has not been - // implemented on the Linux platform yet, this is the only way to get a high - // priority thread on Linux. + // followed by SetThreadPriority(). static bool CreateWithPriority(size_t stack_size, Delegate* delegate, PlatformThreadHandle* thread_handle, ThreadPriority priority); @@ -191,6 +192,8 @@ class BASE_EXPORT PlatformThread { static void SetThreadPriority(PlatformThreadHandle handle, ThreadPriority priority); + static ThreadPriority GetThreadPriority(PlatformThreadHandle handle); + private: DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); }; |