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