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 DWORD last_error = ::GetLastError(); | 65 RTC_CHECK_EQ(static_cast<DWORD>(ERROR_NOT_ENOUGH_QUOTA), ::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); | |
72 Sleep(1); | 66 Sleep(1); |
73 } | 67 } |
74 thread_.Stop(); | 68 thread_.Stop(); |
75 } | 69 } |
76 | 70 |
77 // static | 71 // static |
78 TaskQueue* TaskQueue::Current() { | 72 TaskQueue* TaskQueue::Current() { |
79 return static_cast<TaskQueue*>(TlsGetValue(GetQueuePtrTls())); | 73 return static_cast<TaskQueue*>(TlsGetValue(GetQueuePtrTls())); |
80 } | 74 } |
81 | 75 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 175 } |
182 } else { | 176 } else { |
183 TranslateMessage(&msg); | 177 TranslateMessage(&msg); |
184 DispatchMessage(&msg); | 178 DispatchMessage(&msg); |
185 } | 179 } |
186 } | 180 } |
187 | 181 |
188 return false; | 182 return false; |
189 } | 183 } |
190 } // namespace rtc | 184 } // namespace rtc |
OLD | NEW |