| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 Event event(false, false); | 55 Event event(false, false); |
| 56 ThreadStartupData startup = {&event, this}; | 56 ThreadStartupData startup = {&event, this}; |
| 57 RTC_CHECK(thread_.QueueAPC(&InitializeQueueThread, | 57 RTC_CHECK(thread_.QueueAPC(&InitializeQueueThread, |
| 58 reinterpret_cast<ULONG_PTR>(&startup))); | 58 reinterpret_cast<ULONG_PTR>(&startup))); |
| 59 event.Wait(Event::kForever); | 59 event.Wait(Event::kForever); |
| 60 } | 60 } |
| 61 | 61 |
| 62 TaskQueue::~TaskQueue() { | 62 TaskQueue::~TaskQueue() { |
| 63 RTC_DCHECK(!IsCurrent()); | 63 RTC_DCHECK(!IsCurrent()); |
| 64 while (!PostThreadMessage(thread_.GetThreadRef(), WM_QUIT, 0, 0)) { | 64 while (!PostThreadMessage(thread_.GetThreadRef(), WM_QUIT, 0, 0)) { |
| 65 RTC_CHECK_EQ(static_cast<DWORD>(ERROR_NOT_ENOUGH_QUOTA), ::GetLastError()); | 65 DWORD last_error = ::GetLastError(); |
| 66 if (last_error == ERROR_SUCCESS) { |
| 67 // TODO(tommi): Figure out what's going on on the Win10 build bot when |
| 68 // we get this error. |
| 69 break; |
| 70 } |
| 71 RTC_CHECK_EQ(static_cast<DWORD>(ERROR_NOT_ENOUGH_QUOTA), last_error); |
| 66 Sleep(1); | 72 Sleep(1); |
| 67 } | 73 } |
| 68 thread_.Stop(); | 74 thread_.Stop(); |
| 69 } | 75 } |
| 70 | 76 |
| 71 // static | 77 // static |
| 72 TaskQueue* TaskQueue::Current() { | 78 TaskQueue* TaskQueue::Current() { |
| 73 return static_cast<TaskQueue*>(TlsGetValue(GetQueuePtrTls())); | 79 return static_cast<TaskQueue*>(TlsGetValue(GetQueuePtrTls())); |
| 74 } | 80 } |
| 75 | 81 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 181 } |
| 176 } else { | 182 } else { |
| 177 TranslateMessage(&msg); | 183 TranslateMessage(&msg); |
| 178 DispatchMessage(&msg); | 184 DispatchMessage(&msg); |
| 179 } | 185 } |
| 180 } | 186 } |
| 181 | 187 |
| 182 return false; | 188 return false; |
| 183 } | 189 } |
| 184 } // namespace rtc | 190 } // namespace rtc |
| OLD | NEW |