OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 { | 111 { |
112 rtc::CritScope lock(&lock_); | 112 rtc::CritScope lock(&lock_); |
113 queue_.push(task.release()); | 113 queue_.push(task.release()); |
114 } | 114 } |
115 wake_up_->Set(); | 115 wake_up_->Set(); |
116 } | 116 } |
117 | 117 |
118 void ProcessThreadImpl::RegisterModule(Module* module, | 118 void ProcessThreadImpl::RegisterModule(Module* module, |
119 const rtc::Location& from) { | 119 const rtc::Location& from) { |
120 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 120 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
121 RTC_DCHECK(module); | 121 RTC_DCHECK(module) << from.ToString(); |
122 | 122 |
123 #if RTC_DCHECK_IS_ON | 123 #if RTC_DCHECK_IS_ON |
124 { | 124 { |
125 // Catch programmer error. | 125 // Catch programmer error. |
126 rtc::CritScope lock(&lock_); | 126 rtc::CritScope lock(&lock_); |
127 for (const ModuleCallback& mc : modules_) | 127 for (const ModuleCallback& mc : modules_) { |
128 RTC_DCHECK(mc.module != module); | 128 RTC_DCHECK(mc.module != module) |
| 129 << "Already registered here: " << mc.location.ToString() << "\n" |
| 130 << "Now attempting from here: " << from.ToString(); |
| 131 } |
129 } | 132 } |
130 #endif | 133 #endif |
131 | 134 |
132 // Now that we know the module isn't in the list, we'll call out to notify | 135 // Now that we know the module isn't in the list, we'll call out to notify |
133 // the module that it's attached to the worker thread. We don't hold | 136 // the module that it's attached to the worker thread. We don't hold |
134 // the lock while we make this call. | 137 // the lock while we make this call. |
135 if (thread_.get()) | 138 if (thread_.get()) |
136 module->ProcessThreadAttached(this); | 139 module->ProcessThreadAttached(this); |
137 | 140 |
138 { | 141 { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 215 } |
213 } | 216 } |
214 | 217 |
215 int64_t time_to_wait = next_checkpoint - rtc::TimeMillis(); | 218 int64_t time_to_wait = next_checkpoint - rtc::TimeMillis(); |
216 if (time_to_wait > 0) | 219 if (time_to_wait > 0) |
217 wake_up_->Wait(static_cast<unsigned long>(time_to_wait)); | 220 wake_up_->Wait(static_cast<unsigned long>(time_to_wait)); |
218 | 221 |
219 return true; | 222 return true; |
220 } | 223 } |
221 } // namespace webrtc | 224 } // namespace webrtc |
OLD | NEW |