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

Unified Diff: webrtc/base/platform_thread.h

Issue 1908373002: Update PlatformThread to support a couple of new properties. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | webrtc/base/platform_thread.cc » ('j') | webrtc/base/platform_thread_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/platform_thread.h
diff --git a/webrtc/base/platform_thread.h b/webrtc/base/platform_thread.h
index 53465e4b17a2f06334cefc17d91add8bd23c9019..8c2161baa891c4018c8ca3b18995349a25e9752f 100644
--- a/webrtc/base/platform_thread.h
+++ b/webrtc/base/platform_thread.h
@@ -59,18 +59,30 @@ class PlatformThread {
PlatformThread(ThreadRunFunction func, void* obj, const char* thread_name);
virtual ~PlatformThread();
+ const std::string& name() const { return name_; }
+
// Spawns a thread and tries to set thread priority according to the priority
// from when CreateThread was called.
void Start();
bool IsRunning() const;
+ // Returns an identifier for the worker thread that can be used to do
+ // thread checks.
+ PlatformThreadRef GetThreadRef() const;
+
// Stops (joins) the spawned thread.
void Stop();
// Set the priority of the thread. Must be called when thread is running.
bool SetPriority(ThreadPriority priority);
+ protected:
+#if defined(WEBRTC_WIN)
+ // Exposed to derived classes to allow for special cases specific to Windows.
+ bool QueueAPC(PAPCFUNC apc_function, ULONG_PTR data);
+#endif
+
private:
void Run();
@@ -85,6 +97,7 @@ class PlatformThread {
bool stop_;
HANDLE thread_;
+ DWORD thread_id_;
#else
static void* StartThread(void* param);
« no previous file with comments | « no previous file | webrtc/base/platform_thread.cc » ('j') | webrtc/base/platform_thread_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698