| Index: webrtc/base/platform_thread.h
|
| diff --git a/webrtc/base/platform_thread.h b/webrtc/base/platform_thread.h
|
| index 667407fabc4299b034ae7ad0203044ba6caecf89..ed26ca03cc70d1e2d05814b05733c02d34241de8 100644
|
| --- a/webrtc/base/platform_thread.h
|
| +++ b/webrtc/base/platform_thread.h
|
| @@ -32,7 +32,8 @@ void SetCurrentThreadName(const char* name);
|
| // Callback function that the spawned thread will enter once spawned.
|
| // A return value of false is interpreted as that the function has no
|
| // more work to do and that the thread can be released.
|
| -typedef bool (*ThreadRunFunction)(void*);
|
| +typedef bool (*ThreadRunFunctionDeprecated)(void*);
|
| +typedef void (*ThreadRunFunction)(void*);
|
|
|
| enum ThreadPriority {
|
| #ifdef WEBRTC_WIN
|
| @@ -55,7 +56,13 @@ enum ThreadPriority {
|
| // called from the same thread, including instantiation.
|
| class PlatformThread {
|
| public:
|
| - PlatformThread(ThreadRunFunction func, void* obj, const char* thread_name);
|
| + PlatformThread(ThreadRunFunctionDeprecated func,
|
| + void* obj,
|
| + const char* thread_name);
|
| + PlatformThread(ThreadRunFunction func,
|
| + void* obj,
|
| + const char* thread_name,
|
| + ThreadPriority priority = kNormalPriority);
|
| virtual ~PlatformThread();
|
|
|
| const std::string& name() const { return name_; }
|
| @@ -74,6 +81,7 @@ class PlatformThread {
|
| void Stop();
|
|
|
| // Set the priority of the thread. Must be called when thread is running.
|
| + // TODO(tommi): Make private and only allow public support via ctor.
|
| bool SetPriority(ThreadPriority priority);
|
|
|
| protected:
|
| @@ -85,12 +93,15 @@ class PlatformThread {
|
| private:
|
| void Run();
|
|
|
| - ThreadRunFunction const run_function_;
|
| + ThreadRunFunctionDeprecated const run_function_deprecated_ = nullptr;
|
| + ThreadRunFunction const run_function_ = nullptr;
|
| + const ThreadPriority priority_ = kNormalPriority;
|
| void* const obj_;
|
| // TODO(pbos): Make sure call sites use string literals and update to a const
|
| // char* instead of a std::string.
|
| const std::string name_;
|
| rtc::ThreadChecker thread_checker_;
|
| + rtc::ThreadChecker spawned_thread_checker_;
|
| #if defined(WEBRTC_WIN)
|
| static DWORD WINAPI StartThread(void* param);
|
|
|
|
|