Tommi | bebc690 | 2015-05-18 09:51:42 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "webrtc/base/platform_thread.h" |
| 12 | |
tommi | 82ead60 | 2017-02-19 16:09:55 -0800 | [diff] [blame] | 13 | #include "webrtc/base/atomicops.h" |
Tommi | bebc690 | 2015-05-18 09:51:42 +0200 | [diff] [blame] | 14 | #include "webrtc/base/checks.h" |
tommi | 500f1b7 | 2017-03-02 07:07:09 -0800 | [diff] [blame] | 15 | #include "webrtc/base/timeutils.h" |
Tommi | bebc690 | 2015-05-18 09:51:42 +0200 | [diff] [blame] | 16 | |
| 17 | #if defined(WEBRTC_LINUX) |
Tommi | ea14f0a | 2015-05-18 13:51:06 +0200 | [diff] [blame] | 18 | #include <sys/prctl.h> |
Tommi | bebc690 | 2015-05-18 09:51:42 +0200 | [diff] [blame] | 19 | #include <sys/syscall.h> |
| 20 | #endif |
| 21 | |
| 22 | namespace rtc { |
| 23 | |
| 24 | PlatformThreadId CurrentThreadId() { |
| 25 | PlatformThreadId ret; |
| 26 | #if defined(WEBRTC_WIN) |
| 27 | ret = GetCurrentThreadId(); |
| 28 | #elif defined(WEBRTC_POSIX) |
| 29 | #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS) |
| 30 | ret = pthread_mach_thread_np(pthread_self()); |
| 31 | #elif defined(WEBRTC_LINUX) |
| 32 | ret = syscall(__NR_gettid); |
| 33 | #elif defined(WEBRTC_ANDROID) |
| 34 | ret = gettid(); |
| 35 | #else |
| 36 | // Default implementation for nacl and solaris. |
| 37 | ret = reinterpret_cast<pid_t>(pthread_self()); |
| 38 | #endif |
| 39 | #endif // defined(WEBRTC_POSIX) |
henrikg | 91d6ede | 2015-09-17 00:24:34 -0700 | [diff] [blame] | 40 | RTC_DCHECK(ret); |
Tommi | bebc690 | 2015-05-18 09:51:42 +0200 | [diff] [blame] | 41 | return ret; |
| 42 | } |
| 43 | |
| 44 | PlatformThreadRef CurrentThreadRef() { |
| 45 | #if defined(WEBRTC_WIN) |
| 46 | return GetCurrentThreadId(); |
| 47 | #elif defined(WEBRTC_POSIX) |
| 48 | return pthread_self(); |
| 49 | #endif |
| 50 | } |
| 51 | |
| 52 | bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b) { |
| 53 | #if defined(WEBRTC_WIN) |
| 54 | return a == b; |
| 55 | #elif defined(WEBRTC_POSIX) |
| 56 | return pthread_equal(a, b); |
| 57 | #endif |
| 58 | } |
| 59 | |
Tommi | ea14f0a | 2015-05-18 13:51:06 +0200 | [diff] [blame] | 60 | void SetCurrentThreadName(const char* name) { |
Tommi | ea14f0a | 2015-05-18 13:51:06 +0200 | [diff] [blame] | 61 | #if defined(WEBRTC_WIN) |
| 62 | struct { |
| 63 | DWORD dwType; |
| 64 | LPCSTR szName; |
| 65 | DWORD dwThreadID; |
| 66 | DWORD dwFlags; |
| 67 | } threadname_info = {0x1000, name, static_cast<DWORD>(-1), 0}; |
| 68 | |
| 69 | __try { |
| 70 | ::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(DWORD), |
| 71 | reinterpret_cast<ULONG_PTR*>(&threadname_info)); |
| 72 | } __except (EXCEPTION_EXECUTE_HANDLER) { |
| 73 | } |
| 74 | #elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) |
| 75 | prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name)); |
| 76 | #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS) |
| 77 | pthread_setname_np(name); |
| 78 | #endif |
| 79 | } |
| 80 | |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 81 | namespace { |
| 82 | #if defined(WEBRTC_WIN) |
| 83 | void CALLBACK RaiseFlag(ULONG_PTR param) { |
| 84 | *reinterpret_cast<bool*>(param) = true; |
| 85 | } |
| 86 | #else |
| 87 | struct ThreadAttributes { |
| 88 | ThreadAttributes() { pthread_attr_init(&attr); } |
| 89 | ~ThreadAttributes() { pthread_attr_destroy(&attr); } |
| 90 | pthread_attr_t* operator&() { return &attr; } |
| 91 | pthread_attr_t attr; |
| 92 | }; |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 93 | #endif // defined(WEBRTC_WIN) |
| 94 | } |
| 95 | |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 96 | PlatformThread::PlatformThread(ThreadRunFunctionDeprecated func, |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 97 | void* obj, |
| 98 | const char* thread_name) |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 99 | : run_function_deprecated_(func), |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 100 | obj_(obj), |
tommi | 82ead60 | 2017-02-19 16:09:55 -0800 | [diff] [blame] | 101 | name_(thread_name ? thread_name : "webrtc") { |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 102 | RTC_DCHECK(func); |
| 103 | RTC_DCHECK(name_.length() < 64); |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 104 | spawned_thread_checker_.DetachFromThread(); |
| 105 | } |
| 106 | |
| 107 | PlatformThread::PlatformThread(ThreadRunFunction func, |
| 108 | void* obj, |
| 109 | const char* thread_name, |
| 110 | ThreadPriority priority /*= kNormalPriority*/) |
| 111 | : run_function_(func), priority_(priority), obj_(obj), name_(thread_name) { |
| 112 | RTC_DCHECK(func); |
| 113 | RTC_DCHECK(!name_.empty()); |
| 114 | // TODO(tommi): Consider lowering the limit to 15 (limit on Linux). |
| 115 | RTC_DCHECK(name_.length() < 64); |
| 116 | spawned_thread_checker_.DetachFromThread(); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | PlatformThread::~PlatformThread() { |
| 120 | RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 121 | #if defined(WEBRTC_WIN) |
| 122 | RTC_DCHECK(!thread_); |
tommi | 845afa8 | 2016-04-22 09:08:44 -0700 | [diff] [blame] | 123 | RTC_DCHECK(!thread_id_); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 124 | #endif // defined(WEBRTC_WIN) |
| 125 | } |
| 126 | |
| 127 | #if defined(WEBRTC_WIN) |
| 128 | DWORD WINAPI PlatformThread::StartThread(void* param) { |
perkj | 6a2e20a | 2016-11-30 04:53:08 -0800 | [diff] [blame] | 129 | // The GetLastError() function only returns valid results when it is called |
| 130 | // after a Win32 API function that returns a "failed" result. A crash dump |
| 131 | // contains the result from GetLastError() and to make sure it does not |
| 132 | // falsely report a Windows error we call SetLastError here. |
| 133 | ::SetLastError(ERROR_SUCCESS); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 134 | static_cast<PlatformThread*>(param)->Run(); |
| 135 | return 0; |
| 136 | } |
| 137 | #else |
| 138 | void* PlatformThread::StartThread(void* param) { |
| 139 | static_cast<PlatformThread*>(param)->Run(); |
| 140 | return 0; |
| 141 | } |
| 142 | #endif // defined(WEBRTC_WIN) |
| 143 | |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 144 | void PlatformThread::Start() { |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 145 | RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 146 | RTC_DCHECK(!thread_) << "Thread already started?"; |
| 147 | #if defined(WEBRTC_WIN) |
| 148 | stop_ = false; |
| 149 | |
| 150 | // See bug 2902 for background on STACK_SIZE_PARAM_IS_A_RESERVATION. |
| 151 | // Set the reserved stack stack size to 1M, which is the default on Windows |
| 152 | // and Linux. |
deadbeef | 37f5ecf | 2017-02-27 14:06:41 -0800 | [diff] [blame] | 153 | thread_ = ::CreateThread(nullptr, 1024 * 1024, &StartThread, this, |
tommi | 845afa8 | 2016-04-22 09:08:44 -0700 | [diff] [blame] | 154 | STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_id_); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 155 | RTC_CHECK(thread_) << "CreateThread failed"; |
tommi | 845afa8 | 2016-04-22 09:08:44 -0700 | [diff] [blame] | 156 | RTC_DCHECK(thread_id_); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 157 | #else |
| 158 | ThreadAttributes attr; |
| 159 | // Set the stack stack size to 1M. |
| 160 | pthread_attr_setstacksize(&attr, 1024 * 1024); |
| 161 | RTC_CHECK_EQ(0, pthread_create(&thread_, &attr, &StartThread, this)); |
| 162 | #endif // defined(WEBRTC_WIN) |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 163 | } |
| 164 | |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 165 | bool PlatformThread::IsRunning() const { |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 166 | RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 167 | #if defined(WEBRTC_WIN) |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 168 | return thread_ != nullptr; |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 169 | #else |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 170 | return thread_ != 0; |
| 171 | #endif // defined(WEBRTC_WIN) |
| 172 | } |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 173 | |
tommi | 845afa8 | 2016-04-22 09:08:44 -0700 | [diff] [blame] | 174 | PlatformThreadRef PlatformThread::GetThreadRef() const { |
| 175 | #if defined(WEBRTC_WIN) |
| 176 | return thread_id_; |
| 177 | #else |
| 178 | return thread_; |
| 179 | #endif // defined(WEBRTC_WIN) |
| 180 | } |
| 181 | |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 182 | void PlatformThread::Stop() { |
| 183 | RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 184 | if (!IsRunning()) |
| 185 | return; |
| 186 | |
| 187 | #if defined(WEBRTC_WIN) |
| 188 | // Set stop_ to |true| on the worker thread. |
tommi | 845afa8 | 2016-04-22 09:08:44 -0700 | [diff] [blame] | 189 | bool queued = QueueAPC(&RaiseFlag, reinterpret_cast<ULONG_PTR>(&stop_)); |
| 190 | // Queuing the APC can fail if the thread is being terminated. |
| 191 | RTC_CHECK(queued || GetLastError() == ERROR_GEN_FAILURE); |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 192 | WaitForSingleObject(thread_, INFINITE); |
| 193 | CloseHandle(thread_); |
| 194 | thread_ = nullptr; |
tommi | 845afa8 | 2016-04-22 09:08:44 -0700 | [diff] [blame] | 195 | thread_id_ = 0; |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 196 | #else |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 197 | if (!run_function_) |
| 198 | RTC_CHECK_EQ(1, AtomicOps::Increment(&stop_flag_)); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 199 | RTC_CHECK_EQ(0, pthread_join(thread_, nullptr)); |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 200 | if (!run_function_) |
| 201 | AtomicOps::ReleaseStore(&stop_flag_, 0); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 202 | thread_ = 0; |
| 203 | #endif // defined(WEBRTC_WIN) |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 204 | spawned_thread_checker_.DetachFromThread(); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 205 | } |
| 206 | |
tommi | 82ead60 | 2017-02-19 16:09:55 -0800 | [diff] [blame] | 207 | // TODO(tommi): Deprecate the loop behavior in PlatformThread. |
| 208 | // * Introduce a new callback type that returns void. |
| 209 | // * Remove potential for a busy loop in PlatformThread. |
| 210 | // * Delegate the responsibility for how to stop the thread, to the |
| 211 | // implementation that actually uses the thread. |
| 212 | // All implementations will need to be aware of how the thread should be stopped |
| 213 | // and encouraging a busy polling loop, can be costly in terms of power and cpu. |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 214 | void PlatformThread::Run() { |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 215 | // Attach the worker thread checker to this thread. |
| 216 | RTC_DCHECK(spawned_thread_checker_.CalledOnValidThread()); |
| 217 | rtc::SetCurrentThreadName(name_.c_str()); |
| 218 | |
| 219 | if (run_function_) { |
| 220 | SetPriority(priority_); |
| 221 | run_function_(obj_); |
| 222 | return; |
| 223 | } |
tommi | 500f1b7 | 2017-03-02 07:07:09 -0800 | [diff] [blame] | 224 | |
| 225 | // TODO(tommi): Delete the rest of this function when looping isn't supported. |
| 226 | #if RTC_DCHECK_IS_ON |
| 227 | // These constants control the busy loop detection algorithm below. |
| 228 | // |kMaxLoopCount| controls the limit for how many times we allow the loop |
| 229 | // to run within a period, before DCHECKing. |
| 230 | // |kPeriodToMeasureMs| controls how long that period is. |
| 231 | static const int kMaxLoopCount = 1000; |
| 232 | static const int kPeriodToMeasureMs = 100; |
| 233 | int64_t loop_stamps[kMaxLoopCount] = {}; |
| 234 | int64_t sequence_nr = 0; |
danilchap | 2752347 | 2017-02-28 06:20:38 -0800 | [diff] [blame] | 235 | #endif |
tommi | 500f1b7 | 2017-03-02 07:07:09 -0800 | [diff] [blame] | 236 | |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 237 | do { |
sprang | e791ffd | 2016-01-26 01:53:20 -0800 | [diff] [blame] | 238 | // The interface contract of Start/Stop is that for a successful call to |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 239 | // Start, there should be at least one call to the run function. So we |
| 240 | // call the function before checking |stop_|. |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 241 | if (!run_function_deprecated_(obj_)) |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 242 | break; |
tommi | 500f1b7 | 2017-03-02 07:07:09 -0800 | [diff] [blame] | 243 | #if RTC_DCHECK_IS_ON |
| 244 | auto id = sequence_nr % kMaxLoopCount; |
| 245 | loop_stamps[id] = rtc::TimeMillis(); |
| 246 | if (sequence_nr > kMaxLoopCount) { |
| 247 | auto compare_id = (id + 1) % kMaxLoopCount; |
| 248 | auto diff = loop_stamps[id] - loop_stamps[compare_id]; |
| 249 | RTC_DCHECK_GE(diff, 0); |
| 250 | if (diff < kPeriodToMeasureMs) { |
| 251 | RTC_NOTREACHED() << "This thread is too busy: " << name_ << " " << diff |
| 252 | << "ms sequence=" << sequence_nr << " " |
| 253 | << loop_stamps[id] << " vs " << loop_stamps[compare_id] |
| 254 | << ", " << id << " vs " << compare_id; |
| 255 | } |
| 256 | } |
| 257 | ++sequence_nr; |
| 258 | #endif |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 259 | #if defined(WEBRTC_WIN) |
| 260 | // Alertable sleep to permit RaiseFlag to run and update |stop_|. |
| 261 | SleepEx(0, true); |
| 262 | } while (!stop_); |
| 263 | #else |
tommi | 0473b1d | 2017-03-02 08:08:59 -0800 | [diff] [blame] | 264 | #if defined(WEBRTC_MAC) |
| 265 | sched_yield(); |
| 266 | #else |
tommi | 500f1b7 | 2017-03-02 07:07:09 -0800 | [diff] [blame] | 267 | static const struct timespec ts_null = {0}; |
danilchap | 2752347 | 2017-02-28 06:20:38 -0800 | [diff] [blame] | 268 | nanosleep(&ts_null, nullptr); |
| 269 | #endif |
tommi | 82ead60 | 2017-02-19 16:09:55 -0800 | [diff] [blame] | 270 | } while (!AtomicOps::AcquireLoad(&stop_flag_)); |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 271 | #endif // defined(WEBRTC_WIN) |
| 272 | } |
| 273 | |
| 274 | bool PlatformThread::SetPriority(ThreadPriority priority) { |
tommi | 0f8b403 | 2017-02-22 11:22:05 -0800 | [diff] [blame] | 275 | #if RTC_DCHECK_IS_ON |
| 276 | if (run_function_) { |
| 277 | // The non-deprecated way of how this function gets called, is that it must |
| 278 | // be called on the worker thread itself. |
| 279 | RTC_DCHECK(spawned_thread_checker_.CalledOnValidThread()); |
| 280 | } else { |
| 281 | // In the case of deprecated use of this method, it must be called on the |
| 282 | // same thread as the PlatformThread object is constructed on. |
| 283 | RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 284 | RTC_DCHECK(IsRunning()); |
| 285 | } |
| 286 | #endif |
| 287 | |
Peter Boström | c661213 | 2015-11-24 18:10:24 +0100 | [diff] [blame] | 288 | #if defined(WEBRTC_WIN) |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 289 | return SetThreadPriority(thread_, priority) != FALSE; |
Peter Boström | c661213 | 2015-11-24 18:10:24 +0100 | [diff] [blame] | 290 | #elif defined(__native_client__) |
| 291 | // Setting thread priorities is not supported in NaCl. |
| 292 | return true; |
| 293 | #elif defined(WEBRTC_CHROMIUM_BUILD) && defined(WEBRTC_LINUX) |
| 294 | // TODO(tommi): Switch to the same mechanism as Chromium uses for changing |
| 295 | // thread priorities. |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 296 | return true; |
| 297 | #else |
| 298 | #ifdef WEBRTC_THREAD_RR |
| 299 | const int policy = SCHED_RR; |
| 300 | #else |
| 301 | const int policy = SCHED_FIFO; |
| 302 | #endif |
| 303 | const int min_prio = sched_get_priority_min(policy); |
| 304 | const int max_prio = sched_get_priority_max(policy); |
| 305 | if (min_prio == -1 || max_prio == -1) { |
| 306 | return false; |
| 307 | } |
| 308 | |
| 309 | if (max_prio - min_prio <= 2) |
| 310 | return false; |
| 311 | |
Peter Boström | 97c821d | 2015-11-24 13:48:13 +0100 | [diff] [blame] | 312 | // Convert webrtc priority to system priorities: |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 313 | sched_param param; |
Peter Boström | 97c821d | 2015-11-24 13:48:13 +0100 | [diff] [blame] | 314 | const int top_prio = max_prio - 1; |
| 315 | const int low_prio = min_prio + 1; |
| 316 | switch (priority) { |
| 317 | case kLowPriority: |
| 318 | param.sched_priority = low_prio; |
| 319 | break; |
| 320 | case kNormalPriority: |
| 321 | // The -1 ensures that the kHighPriority is always greater or equal to |
| 322 | // kNormalPriority. |
| 323 | param.sched_priority = (low_prio + top_prio - 1) / 2; |
| 324 | break; |
| 325 | case kHighPriority: |
| 326 | param.sched_priority = std::max(top_prio - 2, low_prio); |
| 327 | break; |
| 328 | case kHighestPriority: |
| 329 | param.sched_priority = std::max(top_prio - 1, low_prio); |
| 330 | break; |
| 331 | case kRealtimePriority: |
| 332 | param.sched_priority = top_prio; |
| 333 | break; |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 334 | } |
Peter Boström | 97c821d | 2015-11-24 13:48:13 +0100 | [diff] [blame] | 335 | return pthread_setschedparam(thread_, policy, ¶m) == 0; |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 336 | #endif // defined(WEBRTC_WIN) |
| 337 | } |
| 338 | |
tommi | 845afa8 | 2016-04-22 09:08:44 -0700 | [diff] [blame] | 339 | #if defined(WEBRTC_WIN) |
| 340 | bool PlatformThread::QueueAPC(PAPCFUNC function, ULONG_PTR data) { |
| 341 | RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 342 | RTC_DCHECK(IsRunning()); |
| 343 | |
| 344 | return QueueUserAPC(function, thread_, data) != FALSE; |
| 345 | } |
| 346 | #endif |
| 347 | |
Peter Boström | 8c38e8b | 2015-11-26 17:45:47 +0100 | [diff] [blame] | 348 | } // namespace rtc |