Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: webrtc/base/thread_checker.h

Issue 2055473002: Moves macros ACCESS_ON/RUN_ON from thread_annotations to thread_checker (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/thread_annotations.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « webrtc/base/thread_annotations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698