mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Delete windows-specific stop flag in PlatformThread
Followup to https://webrtc-review.googlesource.com/c/src/+/134642 Bug: webrtc:10594 Change-Id: I9935f861a1ab5d9e05a5317243e895cf4f797ab6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135103 Reviewed-by: Tommi <tommi@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27857}
This commit is contained in:
parent
4487ac4a53
commit
22660f34a1
2 changed files with 1 additions and 19 deletions
|
@ -21,11 +21,7 @@
|
|||
|
||||
namespace rtc {
|
||||
namespace {
|
||||
#if defined(WEBRTC_WIN)
|
||||
void CALLBACK RaiseFlag(ULONG_PTR param) {
|
||||
*reinterpret_cast<bool*>(param) = true;
|
||||
}
|
||||
#else
|
||||
#if !defined(WEBRTC_WIN)
|
||||
struct ThreadAttributes {
|
||||
ThreadAttributes() { pthread_attr_init(&attr); }
|
||||
~ThreadAttributes() { pthread_attr_destroy(&attr); }
|
||||
|
@ -76,8 +72,6 @@ void PlatformThread::Start() {
|
|||
RTC_DCHECK(thread_checker_.IsCurrent());
|
||||
RTC_DCHECK(!thread_) << "Thread already started?";
|
||||
#if defined(WEBRTC_WIN)
|
||||
stop_ = false;
|
||||
|
||||
// See bug 2902 for background on STACK_SIZE_PARAM_IS_A_RESERVATION.
|
||||
// Set the reserved stack stack size to 1M, which is the default on Windows
|
||||
// and Linux.
|
||||
|
@ -116,17 +110,6 @@ void PlatformThread::Stop() {
|
|||
return;
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
// Set stop_ to |true| on the worker thread.
|
||||
bool queued = QueueAPC(&RaiseFlag, reinterpret_cast<ULONG_PTR>(&stop_));
|
||||
if (!queued) {
|
||||
// Queuing the APC can fail if the thread is being terminated. This should
|
||||
// return ERROR_GEN_FAILURE, though Wine returns ERROR_ACCESS_DENIED, so
|
||||
// allow for either.
|
||||
auto error = ::GetLastError();
|
||||
if (error != ERROR_GEN_FAILURE && error != ERROR_ACCESS_DENIED) {
|
||||
RTC_CHECK(false) << "Failed to QueueUserAPC, error: " << error;
|
||||
}
|
||||
}
|
||||
WaitForSingleObject(thread_, INFINITE);
|
||||
CloseHandle(thread_);
|
||||
thread_ = nullptr;
|
||||
|
|
|
@ -89,7 +89,6 @@ class PlatformThread {
|
|||
#if defined(WEBRTC_WIN)
|
||||
static DWORD WINAPI StartThread(void* param);
|
||||
|
||||
bool stop_ = false;
|
||||
HANDLE thread_ = nullptr;
|
||||
DWORD thread_id_ = 0;
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue