Moves macros ACCESS_ON/RUN_ON from thread_annotations to thread_checker

to be compatible with projects that has own base/thread_annotation.h

NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2055473002
Cr-Commit-Position: refs/heads/master@{#13090}
This commit is contained in:
danilchap
2016-06-09 07:55:24 -07:00
committed by Commit bot
parent f9da44dbcf
commit 8e85b3c349
2 changed files with 7 additions and 5 deletions

View File

@ -32,9 +32,6 @@
// is primarily used when the client cannot express the name of the lock.
#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
#define GUARDED_VAR THREAD_ANNOTATION_ATTRIBUTE__(guarded)
// Document if a variable/field is not shared and should be accessed from
// same thread/task queue.
#define ACCESS_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
// Document if the memory location pointed to by a pointer should be guarded
// by a lock when dereferencing the pointer. Similar to GUARDED_VAR,
@ -61,8 +58,6 @@
// Document if a function expects certain locks to be held before it is called
#define EXCLUSIVE_LOCKS_REQUIRED(...) \
THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
// Document if a function expected to be called from same thread/task queue.
#define RUN_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(x))
#define SHARED_LOCKS_REQUIRED(...) \
THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__))

View File

@ -173,6 +173,13 @@ class SCOPED_LOCKABLE AnnounceOnThread {
// rtc::scoped_ref_ptr<Encoder> encoder_;
// }
// Document if a variable/field is not shared and should be accessed from
// same thread/task queue.
#define ACCESS_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
// Document if a function expected to be called from same thread/task queue.
#define RUN_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(x))
#define RTC_DCHECK_RUN_ON(thread_like_object) \
rtc::internal::AnnounceOnThread thread_announcer(thread_like_object); \
RTC_DCHECK(rtc::internal::AnnounceOnThread::IsCurrent(thread_like_object))