| 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 22 matching lines...) Expand all Loading... |
| 33 return g_queue_ptr_tls; | 33 return g_queue_ptr_tls; |
| 34 } | 34 } |
| 35 | 35 |
| 36 struct ThreadStartupData { | 36 struct ThreadStartupData { |
| 37 Event* started; | 37 Event* started; |
| 38 void* thread_context; | 38 void* thread_context; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 void CALLBACK InitializeQueueThread(ULONG_PTR param) { | 41 void CALLBACK InitializeQueueThread(ULONG_PTR param) { |
| 42 MSG msg; | 42 MSG msg; |
| 43 PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); | 43 PeekMessage(&msg, nullptr, WM_USER, WM_USER, PM_NOREMOVE); |
| 44 ThreadStartupData* data = reinterpret_cast<ThreadStartupData*>(param); | 44 ThreadStartupData* data = reinterpret_cast<ThreadStartupData*>(param); |
| 45 TlsSetValue(GetQueuePtrTls(), data->thread_context); | 45 TlsSetValue(GetQueuePtrTls(), data->thread_context); |
| 46 data->started->Set(); | 46 data->started->Set(); |
| 47 } | 47 } |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 TaskQueue::TaskQueue(const char* queue_name) | 50 TaskQueue::TaskQueue(const char* queue_name) |
| 51 : thread_(&TaskQueue::ThreadMain, this, queue_name) { | 51 : thread_(&TaskQueue::ThreadMain, this, queue_name) { |
| 52 RTC_DCHECK(queue_name); | 52 RTC_DCHECK(queue_name); |
| 53 thread_.Start(); | 53 thread_.Start(); |
| (...skipping 134 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 |