| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 Event event(false, false); | 54 Event event(false, false); |
| 55 ThreadStartupData startup = {&event, this}; | 55 ThreadStartupData startup = {&event, this}; |
| 56 RTC_CHECK(thread_.QueueAPC(&InitializeQueueThread, | 56 RTC_CHECK(thread_.QueueAPC(&InitializeQueueThread, |
| 57 reinterpret_cast<ULONG_PTR>(&startup))); | 57 reinterpret_cast<ULONG_PTR>(&startup))); |
| 58 event.Wait(Event::kForever); | 58 event.Wait(Event::kForever); |
| 59 } | 59 } |
| 60 | 60 |
| 61 TaskQueue::~TaskQueue() { | 61 TaskQueue::~TaskQueue() { |
| 62 RTC_DCHECK(!IsCurrent()); | 62 RTC_DCHECK(!IsCurrent()); |
| 63 while (!PostThreadMessage(thread_.GetThreadRef(), WM_QUIT, 0, 0)) { | 63 while (!PostThreadMessage(thread_.GetThreadRef(), WM_QUIT, 0, 0)) { |
| 64 RTC_CHECK_EQ(static_cast<DWORD>(ERROR_NOT_ENOUGH_QUOTA), ::GetLastError()); | 64 RTC_CHECK_EQ(ERROR_NOT_ENOUGH_QUOTA, ::GetLastError()); |
| 65 Sleep(1); | 65 Sleep(1); |
| 66 } | 66 } |
| 67 thread_.Stop(); | 67 thread_.Stop(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // static | 70 // static |
| 71 TaskQueue* TaskQueue::Current() { | 71 TaskQueue* TaskQueue::Current() { |
| 72 return static_cast<TaskQueue*>(TlsGetValue(GetQueuePtrTls())); | 72 return static_cast<TaskQueue*>(TlsGetValue(GetQueuePtrTls())); |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 188 } |
| 189 } else { | 189 } else { |
| 190 TranslateMessage(&msg); | 190 TranslateMessage(&msg); |
| 191 DispatchMessage(&msg); | 191 DispatchMessage(&msg); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 return msg.message != WM_QUIT; | 194 return msg.message != WM_QUIT; |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace rtc | 197 } // namespace rtc |
| OLD | NEW |