OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 |
11 #include "webrtc/system_wrappers/source/thread_win.h" | 11 #include "webrtc/system_wrappers/source/thread_win.h" |
12 | 12 |
13 #include <process.h> | 13 #include <process.h> |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 #include <windows.h> | 15 #include <windows.h> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
18 #include "webrtc/base/platform_thread.h" | 18 #include "webrtc/base/platform_thread.h" |
19 #include "webrtc/system_wrappers/interface/trace.h" | 19 #include "webrtc/system_wrappers/include/trace.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 namespace { | 22 namespace { |
23 void CALLBACK RaiseFlag(ULONG_PTR param) { | 23 void CALLBACK RaiseFlag(ULONG_PTR param) { |
24 *reinterpret_cast<bool*>(param) = true; | 24 *reinterpret_cast<bool*>(param) = true; |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
28 ThreadWindows::ThreadWindows(ThreadRunFunction func, void* obj, | 28 ThreadWindows::ThreadWindows(ThreadRunFunction func, void* obj, |
29 const char* thread_name) | 29 const char* thread_name) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Start, there should be at least one call to the run function. So we | 98 // Start, there should be at least one call to the run function. So we |
99 // call the function before checking |stop_|. | 99 // call the function before checking |stop_|. |
100 if (!run_function_(obj_)) | 100 if (!run_function_(obj_)) |
101 break; | 101 break; |
102 // Alertable sleep to permit RaiseFlag to run and update |stop_|. | 102 // Alertable sleep to permit RaiseFlag to run and update |stop_|. |
103 SleepEx(0, true); | 103 SleepEx(0, true); |
104 } while (!stop_); | 104 } while (!stop_); |
105 } | 105 } |
106 | 106 |
107 } // namespace webrtc | 107 } // namespace webrtc |
OLD | NEW |