| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 void PlatformThread::Start() { | 143 void PlatformThread::Start() { |
| 144 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 144 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 145 RTC_DCHECK(!thread_) << "Thread already started?"; | 145 RTC_DCHECK(!thread_) << "Thread already started?"; |
| 146 #if defined(WEBRTC_WIN) | 146 #if defined(WEBRTC_WIN) |
| 147 stop_ = false; | 147 stop_ = false; |
| 148 | 148 |
| 149 // See bug 2902 for background on STACK_SIZE_PARAM_IS_A_RESERVATION. | 149 // See bug 2902 for background on STACK_SIZE_PARAM_IS_A_RESERVATION. |
| 150 // Set the reserved stack stack size to 1M, which is the default on Windows | 150 // Set the reserved stack stack size to 1M, which is the default on Windows |
| 151 // and Linux. | 151 // and Linux. |
| 152 thread_ = ::CreateThread(NULL, 1024 * 1024, &StartThread, this, | 152 thread_ = ::CreateThread(nullptr, 1024 * 1024, &StartThread, this, |
| 153 STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_id_); | 153 STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_id_); |
| 154 RTC_CHECK(thread_) << "CreateThread failed"; | 154 RTC_CHECK(thread_) << "CreateThread failed"; |
| 155 RTC_DCHECK(thread_id_); | 155 RTC_DCHECK(thread_id_); |
| 156 #else | 156 #else |
| 157 ThreadAttributes attr; | 157 ThreadAttributes attr; |
| 158 // Set the stack stack size to 1M. | 158 // Set the stack stack size to 1M. |
| 159 pthread_attr_setstacksize(&attr, 1024 * 1024); | 159 pthread_attr_setstacksize(&attr, 1024 * 1024); |
| 160 RTC_CHECK_EQ(0, pthread_create(&thread_, &attr, &StartThread, this)); | 160 RTC_CHECK_EQ(0, pthread_create(&thread_, &attr, &StartThread, this)); |
| 161 #endif // defined(WEBRTC_WIN) | 161 #endif // defined(WEBRTC_WIN) |
| 162 } | 162 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 #if defined(WEBRTC_WIN) | 312 #if defined(WEBRTC_WIN) |
| 313 bool PlatformThread::QueueAPC(PAPCFUNC function, ULONG_PTR data) { | 313 bool PlatformThread::QueueAPC(PAPCFUNC function, ULONG_PTR data) { |
| 314 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 314 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 315 RTC_DCHECK(IsRunning()); | 315 RTC_DCHECK(IsRunning()); |
| 316 | 316 |
| 317 return QueueUserAPC(function, thread_, data) != FALSE; | 317 return QueueUserAPC(function, thread_, data) != FALSE; |
| 318 } | 318 } |
| 319 #endif | 319 #endif |
| 320 | 320 |
| 321 } // namespace rtc | 321 } // namespace rtc |
| OLD | NEW |