PlatformThread: add support for detached threads.
The change introduces support for detachable PlatformThreads, for which
the Stop() call doesn't wait until the thread has finished executing.
The change also introduces rtc::ThreadAttributes that carries priority
and detachability thread attributes. It additionally refactors all
known use to use the new semantics.
Bug: b:181572711, webrtc:12659
Change-Id: Id96e87c2a0dafabc8047767d241fd5da4505d14c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214704
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33796}
diff --git a/rtc_base/task_queue_win.cc b/rtc_base/task_queue_win.cc
index 5eb3776..8bfe5e5 100644
--- a/rtc_base/task_queue_win.cc
+++ b/rtc_base/task_queue_win.cc
@@ -175,7 +175,10 @@
void* obj,
absl::string_view thread_name,
rtc::ThreadPriority priority)
- : PlatformThread(func, obj, thread_name, priority) {}
+ : PlatformThread(func,
+ obj,
+ thread_name,
+ rtc::ThreadAttributes().SetPriority(priority)) {}
bool QueueAPC(PAPCFUNC apc_function, ULONG_PTR data) {
return rtc::PlatformThread::QueueAPC(apc_function, data);