OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // // encoder_->Encode(); | 166 // // encoder_->Encode(); |
167 // // Will work: | 167 // // Will work: |
168 // rtc::scoped_ref_ptr<Encoder> encoder = encoder_; | 168 // rtc::scoped_ref_ptr<Encoder> encoder = encoder_; |
169 // encoder_->Queue()->PostTask([encoder] { encoder->Encode(); }); | 169 // encoder_->Queue()->PostTask([encoder] { encoder->Encode(); }); |
170 // } | 170 // } |
171 // | 171 // |
172 // private: | 172 // private: |
173 // rtc::scoped_ref_ptr<Encoder> encoder_; | 173 // rtc::scoped_ref_ptr<Encoder> encoder_; |
174 // } | 174 // } |
175 | 175 |
| 176 // Document if a variable/field is not shared and should be accessed from |
| 177 // same thread/task queue. |
| 178 #define ACCESS_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) |
| 179 |
| 180 // Document if a function expected to be called from same thread/task queue. |
| 181 #define RUN_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(x)) |
| 182 |
176 #define RTC_DCHECK_RUN_ON(thread_like_object) \ | 183 #define RTC_DCHECK_RUN_ON(thread_like_object) \ |
177 rtc::internal::AnnounceOnThread thread_announcer(thread_like_object); \ | 184 rtc::internal::AnnounceOnThread thread_announcer(thread_like_object); \ |
178 RTC_DCHECK(rtc::internal::AnnounceOnThread::IsCurrent(thread_like_object)) | 185 RTC_DCHECK(rtc::internal::AnnounceOnThread::IsCurrent(thread_like_object)) |
179 | 186 |
180 #endif // WEBRTC_BASE_THREAD_CHECKER_H_ | 187 #endif // WEBRTC_BASE_THREAD_CHECKER_H_ |
OLD | NEW |