diff --git a/webrtc/rtc_base/asyncinvoker.h b/webrtc/rtc_base/asyncinvoker.h index 455ded24dd..0b14e910c9 100644 --- a/webrtc/rtc_base/asyncinvoker.h +++ b/webrtc/rtc_base/asyncinvoker.h @@ -248,8 +248,8 @@ class GuardedAsyncInvoker : public sigslot::has_slots<> { void ThreadDestroyed(); CriticalSection crit_; - Thread* thread_ GUARDED_BY(crit_); - AsyncInvoker invoker_ GUARDED_BY(crit_); + Thread* thread_ RTC_GUARDED_BY(crit_); + AsyncInvoker invoker_ RTC_GUARDED_BY(crit_); }; } // namespace rtc diff --git a/webrtc/rtc_base/bufferqueue.h b/webrtc/rtc_base/bufferqueue.h index 3abb8cfa6a..82f1ac1a18 100644 --- a/webrtc/rtc_base/bufferqueue.h +++ b/webrtc/rtc_base/bufferqueue.h @@ -50,8 +50,8 @@ class BufferQueue { size_t capacity_; size_t default_size_; CriticalSection crit_; - std::deque queue_ GUARDED_BY(crit_); - std::vector free_list_ GUARDED_BY(crit_); + std::deque queue_ RTC_GUARDED_BY(crit_); + std::vector free_list_ RTC_GUARDED_BY(crit_); RTC_DISALLOW_COPY_AND_ASSIGN(BufferQueue); }; diff --git a/webrtc/rtc_base/criticalsection.cc b/webrtc/rtc_base/criticalsection.cc index 08acb13317..e73b23c092 100644 --- a/webrtc/rtc_base/criticalsection.cc +++ b/webrtc/rtc_base/criticalsection.cc @@ -56,7 +56,7 @@ CriticalSection::~CriticalSection() { #endif } -void CriticalSection::Enter() const EXCLUSIVE_LOCK_FUNCTION() { +void CriticalSection::Enter() const RTC_EXCLUSIVE_LOCK_FUNCTION() { #if defined(WEBRTC_WIN) EnterCriticalSection(&crit_); #elif defined(WEBRTC_POSIX) @@ -115,7 +115,7 @@ void CriticalSection::Enter() const EXCLUSIVE_LOCK_FUNCTION() { #endif } -bool CriticalSection::TryEnter() const EXCLUSIVE_TRYLOCK_FUNCTION(true) { +bool CriticalSection::TryEnter() const RTC_EXCLUSIVE_TRYLOCK_FUNCTION(true) { #if defined(WEBRTC_WIN) return TryEnterCriticalSection(&crit_) != FALSE; #elif defined(WEBRTC_POSIX) @@ -148,7 +148,7 @@ bool CriticalSection::TryEnter() const EXCLUSIVE_TRYLOCK_FUNCTION(true) { #endif } -void CriticalSection::Leave() const UNLOCK_FUNCTION() { +void CriticalSection::Leave() const RTC_UNLOCK_FUNCTION() { RTC_DCHECK(CurrentThreadIsOwner()); #if defined(WEBRTC_WIN) LeaveCriticalSection(&crit_); diff --git a/webrtc/rtc_base/criticalsection.h b/webrtc/rtc_base/criticalsection.h index 38172d7e0c..fb55aaf0d1 100644 --- a/webrtc/rtc_base/criticalsection.h +++ b/webrtc/rtc_base/criticalsection.h @@ -52,14 +52,14 @@ namespace rtc { // Locking methods (Enter, TryEnter, Leave)are const to permit protecting // members inside a const context without requiring mutable CriticalSections // everywhere. -class LOCKABLE CriticalSection { +class RTC_LOCKABLE CriticalSection { public: CriticalSection(); ~CriticalSection(); - void Enter() const EXCLUSIVE_LOCK_FUNCTION(); - bool TryEnter() const EXCLUSIVE_TRYLOCK_FUNCTION(true); - void Leave() const UNLOCK_FUNCTION(); + void Enter() const RTC_EXCLUSIVE_LOCK_FUNCTION(); + bool TryEnter() const RTC_EXCLUSIVE_TRYLOCK_FUNCTION(true); + void Leave() const RTC_UNLOCK_FUNCTION(); private: // Use only for RTC_DCHECKing. @@ -91,10 +91,11 @@ class LOCKABLE CriticalSection { }; // CritScope, for serializing execution through a scope. -class SCOPED_LOCKABLE CritScope { +class RTC_SCOPED_LOCKABLE CritScope { public: - explicit CritScope(const CriticalSection* cs) EXCLUSIVE_LOCK_FUNCTION(cs); - ~CritScope() UNLOCK_FUNCTION(); + explicit CritScope(const CriticalSection* cs) RTC_EXCLUSIVE_LOCK_FUNCTION(cs); + ~CritScope() RTC_UNLOCK_FUNCTION(); + private: const CriticalSection* const cs_; RTC_DISALLOW_COPY_AND_ASSIGN(CritScope); @@ -127,11 +128,11 @@ class TryCritScope { // A POD lock used to protect global variables. Do NOT use for other purposes. // No custom constructor or private data member should be added. -class LOCKABLE GlobalLockPod { +class RTC_LOCKABLE GlobalLockPod { public: - void Lock() EXCLUSIVE_LOCK_FUNCTION(); + void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION(); - void Unlock() UNLOCK_FUNCTION(); + void Unlock() RTC_UNLOCK_FUNCTION(); volatile int lock_acquired; }; @@ -142,10 +143,12 @@ class GlobalLock : public GlobalLockPod { }; // GlobalLockScope, for serializing execution through a scope. -class SCOPED_LOCKABLE GlobalLockScope { +class RTC_SCOPED_LOCKABLE GlobalLockScope { public: - explicit GlobalLockScope(GlobalLockPod* lock) EXCLUSIVE_LOCK_FUNCTION(lock); - ~GlobalLockScope() UNLOCK_FUNCTION(); + explicit GlobalLockScope(GlobalLockPod* lock) + RTC_EXCLUSIVE_LOCK_FUNCTION(lock); + ~GlobalLockScope() RTC_UNLOCK_FUNCTION(); + private: GlobalLockPod* const lock_; RTC_DISALLOW_COPY_AND_ASSIGN(GlobalLockScope); diff --git a/webrtc/rtc_base/criticalsection_unittest.cc b/webrtc/rtc_base/criticalsection_unittest.cc index 2e136bf804..c264e44bd7 100644 --- a/webrtc/rtc_base/criticalsection_unittest.cc +++ b/webrtc/rtc_base/criticalsection_unittest.cc @@ -113,14 +113,10 @@ class RunnerBase : public MessageHandler { int shared_value_; }; -class LOCKABLE CriticalSectionLock { +class RTC_LOCKABLE CriticalSectionLock { public: - void Lock() EXCLUSIVE_LOCK_FUNCTION() { - cs_.Enter(); - } - void Unlock() UNLOCK_FUNCTION() { - cs_.Leave(); - } + void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION() { cs_.Enter(); } + void Unlock() RTC_UNLOCK_FUNCTION() { cs_.Leave(); } private: CriticalSection cs_; diff --git a/webrtc/rtc_base/event_tracer.cc b/webrtc/rtc_base/event_tracer.cc index 008e698455..c3b459f851 100644 --- a/webrtc/rtc_base/event_tracer.cc +++ b/webrtc/rtc_base/event_tracer.cc @@ -320,7 +320,7 @@ class EventLogger final { } rtc::CriticalSection crit_; - std::vector trace_events_ GUARDED_BY(crit_); + std::vector trace_events_ RTC_GUARDED_BY(crit_); rtc::PlatformThread logging_thread_; rtc::Event shutdown_event_; rtc::ThreadChecker thread_checker_; diff --git a/webrtc/rtc_base/fakeclock.h b/webrtc/rtc_base/fakeclock.h index c5bdab19af..b6a84e6e3d 100644 --- a/webrtc/rtc_base/fakeclock.h +++ b/webrtc/rtc_base/fakeclock.h @@ -42,7 +42,7 @@ class FakeClock : public ClockInterface { } private: CriticalSection lock_; - int64_t time_ GUARDED_BY(lock_) = 0; + int64_t time_ RTC_GUARDED_BY(lock_) = 0; }; // Helper class that sets itself as the global clock in its constructor and diff --git a/webrtc/rtc_base/logging.cc b/webrtc/rtc_base/logging.cc index 4f46b0ad52..d52bd7a4c9 100644 --- a/webrtc/rtc_base/logging.cc +++ b/webrtc/rtc_base/logging.cc @@ -111,7 +111,7 @@ CriticalSection g_log_crit; // Note: we explicitly do not clean this up, because of the uncertain ordering // of destructors at program exit. Let the person who sets the stream trigger // cleanup by setting to null, or let it leak (safe at program exit). -LogMessage::StreamList LogMessage::streams_ GUARDED_BY(g_log_crit); +LogMessage::StreamList LogMessage::streams_ RTC_GUARDED_BY(g_log_crit); // Boolean options default to false (0) bool LogMessage::thread_, LogMessage::timestamp_; @@ -333,7 +333,8 @@ void LogMessage::ConfigureLogging(const char* params) { LogToDebug(debug_level); } -void LogMessage::UpdateMinLogSeverity() EXCLUSIVE_LOCKS_REQUIRED(g_log_crit) { +void LogMessage::UpdateMinLogSeverity() + RTC_EXCLUSIVE_LOCKS_REQUIRED(g_log_crit) { LoggingSeverity min_sev = dbg_sev_; for (auto& kv : streams_) { min_sev = std::min(dbg_sev_, kv.second); diff --git a/webrtc/rtc_base/messagequeue.cc b/webrtc/rtc_base/messagequeue.cc index 883735c9cc..3dd11426eb 100644 --- a/webrtc/rtc_base/messagequeue.cc +++ b/webrtc/rtc_base/messagequeue.cc @@ -23,16 +23,16 @@ namespace { const int kMaxMsgLatency = 150; // 150 ms const int kSlowDispatchLoggingThreshold = 50; // 50 ms -class SCOPED_LOCKABLE MarkProcessingCritScope { +class RTC_SCOPED_LOCKABLE MarkProcessingCritScope { public: MarkProcessingCritScope(const CriticalSection* cs, size_t* processing) - EXCLUSIVE_LOCK_FUNCTION(cs) + RTC_EXCLUSIVE_LOCK_FUNCTION(cs) : cs_(cs), processing_(processing) { cs_->Enter(); *processing_ += 1; } - ~MarkProcessingCritScope() UNLOCK_FUNCTION() { + ~MarkProcessingCritScope() RTC_UNLOCK_FUNCTION() { *processing_ -= 1; cs_->Leave(); } diff --git a/webrtc/rtc_base/messagequeue.h b/webrtc/rtc_base/messagequeue.h index 2345dce7db..79217fb721 100644 --- a/webrtc/rtc_base/messagequeue.h +++ b/webrtc/rtc_base/messagequeue.h @@ -68,13 +68,13 @@ class MessageQueueManager { static MessageQueueManager* instance_; // This list contains all live MessageQueues. - std::vector message_queues_ GUARDED_BY(crit_); + std::vector message_queues_ RTC_GUARDED_BY(crit_); // Methods that don't modify the list of message queues may be called in a // re-entrant fashion. "processing_" keeps track of the depth of re-entrant // calls. CriticalSection crit_; - size_t processing_ GUARDED_BY(crit_); + size_t processing_ RTC_GUARDED_BY(crit_); }; // Derive from this for specialized data @@ -306,9 +306,9 @@ class MessageQueue { bool fPeekKeep_; Message msgPeek_; - MessageList msgq_ GUARDED_BY(crit_); - PriorityQueue dmsgq_ GUARDED_BY(crit_); - uint32_t dmsgq_next_num_ GUARDED_BY(crit_); + MessageList msgq_ RTC_GUARDED_BY(crit_); + PriorityQueue dmsgq_ RTC_GUARDED_BY(crit_); + uint32_t dmsgq_next_num_ RTC_GUARDED_BY(crit_); CriticalSection crit_; bool fInitialized_; bool fDestroyed_; diff --git a/webrtc/rtc_base/physicalsocketserver.h b/webrtc/rtc_base/physicalsocketserver.h index 680b4dd8dd..c91e14e342 100644 --- a/webrtc/rtc_base/physicalsocketserver.h +++ b/webrtc/rtc_base/physicalsocketserver.h @@ -203,7 +203,7 @@ class PhysicalSocket : public AsyncSocket, public sigslot::has_slots<> { SOCKET s_; bool udp_; CriticalSection crit_; - int error_ GUARDED_BY(crit_); + int error_ RTC_GUARDED_BY(crit_); ConnState state_; AsyncResolver* resolver_; diff --git a/webrtc/rtc_base/race_checker.h b/webrtc/rtc_base/race_checker.h index b49db534e3..f0506c8437 100644 --- a/webrtc/rtc_base/race_checker.h +++ b/webrtc/rtc_base/race_checker.h @@ -23,14 +23,14 @@ class RaceCheckerScope; // Best-effort race-checking implementation. This primitive uses no // synchronization at all to be as-fast-as-possible in the non-racy case. -class LOCKABLE RaceChecker { +class RTC_LOCKABLE RaceChecker { public: friend class internal::RaceCheckerScope; RaceChecker(); private: - bool Acquire() const EXCLUSIVE_LOCK_FUNCTION(); - void Release() const UNLOCK_FUNCTION(); + bool Acquire() const RTC_EXCLUSIVE_LOCK_FUNCTION(); + void Release() const RTC_UNLOCK_FUNCTION(); // Volatile to prevent code being optimized away in Acquire()/Release(). mutable volatile int access_count_ = 0; @@ -38,25 +38,25 @@ class LOCKABLE RaceChecker { }; namespace internal { -class SCOPED_LOCKABLE RaceCheckerScope { +class RTC_SCOPED_LOCKABLE RaceCheckerScope { public: explicit RaceCheckerScope(const RaceChecker* race_checker) - EXCLUSIVE_LOCK_FUNCTION(race_checker); + RTC_EXCLUSIVE_LOCK_FUNCTION(race_checker); bool RaceDetected() const; - ~RaceCheckerScope() UNLOCK_FUNCTION(); + ~RaceCheckerScope() RTC_UNLOCK_FUNCTION(); private: const RaceChecker* const race_checker_; const bool race_check_ok_; }; -class SCOPED_LOCKABLE RaceCheckerScopeDoNothing { +class RTC_SCOPED_LOCKABLE RaceCheckerScopeDoNothing { public: explicit RaceCheckerScopeDoNothing(const RaceChecker* race_checker) - EXCLUSIVE_LOCK_FUNCTION(race_checker) {} + RTC_EXCLUSIVE_LOCK_FUNCTION(race_checker) {} - ~RaceCheckerScopeDoNothing() UNLOCK_FUNCTION() {} + ~RaceCheckerScopeDoNothing() RTC_UNLOCK_FUNCTION() {} }; } // namespace internal diff --git a/webrtc/rtc_base/rate_limiter.h b/webrtc/rtc_base/rate_limiter.h index b4b9080faa..e3f6249a5e 100644 --- a/webrtc/rtc_base/rate_limiter.h +++ b/webrtc/rtc_base/rate_limiter.h @@ -44,9 +44,9 @@ class RateLimiter { private: const Clock* const clock_; rtc::CriticalSection lock_; - RateStatistics current_rate_ GUARDED_BY(lock_); - int64_t window_size_ms_ GUARDED_BY(lock_); - uint32_t max_rate_bps_ GUARDED_BY(lock_); + RateStatistics current_rate_ RTC_GUARDED_BY(lock_); + int64_t window_size_ms_ RTC_GUARDED_BY(lock_); + uint32_t max_rate_bps_ RTC_GUARDED_BY(lock_); RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RateLimiter); }; diff --git a/webrtc/rtc_base/sequenced_task_checker.h b/webrtc/rtc_base/sequenced_task_checker.h index 40b07f98e6..35bd3cd4ae 100644 --- a/webrtc/rtc_base/sequenced_task_checker.h +++ b/webrtc/rtc_base/sequenced_task_checker.h @@ -54,17 +54,18 @@ class SequencedTaskCheckerDoNothing { // // In Release mode, CalledOnValidThread will always return true. #if ENABLE_SEQUENCED_TASK_CHECKER -class LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerImpl {}; +class RTC_LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerImpl {}; #else -class LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerDoNothing {}; +class RTC_LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerDoNothing { +}; #endif // ENABLE_SEQUENCED_TASK_CHECKER_H_ namespace internal { -class SCOPED_LOCKABLE SequencedTaskCheckerScope { +class RTC_SCOPED_LOCKABLE SequencedTaskCheckerScope { public: explicit SequencedTaskCheckerScope(const SequencedTaskChecker* checker) - EXCLUSIVE_LOCK_FUNCTION(checker); - ~SequencedTaskCheckerScope() UNLOCK_FUNCTION(); + RTC_EXCLUSIVE_LOCK_FUNCTION(checker); + ~SequencedTaskCheckerScope() RTC_UNLOCK_FUNCTION(); }; } // namespace internal diff --git a/webrtc/rtc_base/sequenced_task_checker_unittest.cc b/webrtc/rtc_base/sequenced_task_checker_unittest.cc index 55fc4744ae..73bc8ea0e3 100644 --- a/webrtc/rtc_base/sequenced_task_checker_unittest.cc +++ b/webrtc/rtc_base/sequenced_task_checker_unittest.cc @@ -237,7 +237,7 @@ class TestAnnotations { } private: - bool test_var_ GUARDED_BY(&checker_); + bool test_var_ RTC_GUARDED_BY(&checker_); SequencedTaskChecker checker_; }; diff --git a/webrtc/rtc_base/signalthread.h b/webrtc/rtc_base/signalthread.h index f6722a7282..1c6c876256 100644 --- a/webrtc/rtc_base/signalthread.h +++ b/webrtc/rtc_base/signalthread.h @@ -119,9 +119,9 @@ class SignalThread RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Worker); }; - class SCOPED_LOCKABLE EnterExit { + class RTC_SCOPED_LOCKABLE EnterExit { public: - explicit EnterExit(SignalThread* t) EXCLUSIVE_LOCK_FUNCTION(t->cs_) + explicit EnterExit(SignalThread* t) RTC_EXCLUSIVE_LOCK_FUNCTION(t->cs_) : t_(t) { t_->cs_.Enter(); // If refcount_ is zero then the object has already been deleted and we @@ -129,7 +129,7 @@ class SignalThread RTC_DCHECK_NE(0, t_->refcount_); ++t_->refcount_; } - ~EnterExit() UNLOCK_FUNCTION() { + ~EnterExit() RTC_UNLOCK_FUNCTION() { bool d = (0 == --t_->refcount_); t_->cs_.Leave(); if (d) diff --git a/webrtc/rtc_base/stream.h b/webrtc/rtc_base/stream.h index 8b7b036e0d..e8418ab759 100644 --- a/webrtc/rtc_base/stream.h +++ b/webrtc/rtc_base/stream.h @@ -539,26 +539,30 @@ class FifoBuffer : public StreamInterface { private: // Helper method that implements ReadOffset. Caller must acquire a lock // when calling this method. - StreamResult ReadOffsetLocked(void* buffer, size_t bytes, size_t offset, + StreamResult ReadOffsetLocked(void* buffer, + size_t bytes, + size_t offset, size_t* bytes_read) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // Helper method that implements WriteOffset. Caller must acquire a lock // when calling this method. - StreamResult WriteOffsetLocked(const void* buffer, size_t bytes, - size_t offset, size_t* bytes_written) - EXCLUSIVE_LOCKS_REQUIRED(crit_); + StreamResult WriteOffsetLocked(const void* buffer, + size_t bytes, + size_t offset, + size_t* bytes_written) + RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); // keeps the opened/closed state of the stream - StreamState state_ GUARDED_BY(crit_); + StreamState state_ RTC_GUARDED_BY(crit_); // the allocated buffer - std::unique_ptr buffer_ GUARDED_BY(crit_); + std::unique_ptr buffer_ RTC_GUARDED_BY(crit_); // size of the allocated buffer - size_t buffer_length_ GUARDED_BY(crit_); + size_t buffer_length_ RTC_GUARDED_BY(crit_); // amount of readable data in the buffer - size_t data_length_ GUARDED_BY(crit_); + size_t data_length_ RTC_GUARDED_BY(crit_); // offset to the readable data - size_t read_position_ GUARDED_BY(crit_); + size_t read_position_ RTC_GUARDED_BY(crit_); // stream callbacks are dispatched on this thread Thread* owner_; // object lock diff --git a/webrtc/rtc_base/swap_queue.h b/webrtc/rtc_base/swap_queue.h index 3519686af9..95bae21bb8 100644 --- a/webrtc/rtc_base/swap_queue.h +++ b/webrtc/rtc_base/swap_queue.h @@ -192,16 +192,16 @@ class SwapQueue { // TODO(peah): Change this to use std::function() once we can use C++11 std // lib. - QueueItemVerifier queue_item_verifier_ GUARDED_BY(crit_queue_); + QueueItemVerifier queue_item_verifier_ RTC_GUARDED_BY(crit_queue_); // (next_read_index_ + num_elements_) % queue_.size() = // next_write_index_ - size_t next_write_index_ GUARDED_BY(crit_queue_) = 0; - size_t next_read_index_ GUARDED_BY(crit_queue_) = 0; - size_t num_elements_ GUARDED_BY(crit_queue_) = 0; + size_t next_write_index_ RTC_GUARDED_BY(crit_queue_) = 0; + size_t next_read_index_ RTC_GUARDED_BY(crit_queue_) = 0; + size_t num_elements_ RTC_GUARDED_BY(crit_queue_) = 0; // queue_.size() is constant. - std::vector queue_ GUARDED_BY(crit_queue_); + std::vector queue_ RTC_GUARDED_BY(crit_queue_); RTC_DISALLOW_COPY_AND_ASSIGN(SwapQueue); }; diff --git a/webrtc/rtc_base/task_queue.h b/webrtc/rtc_base/task_queue.h index 966b29c40d..64e6a6ca5c 100644 --- a/webrtc/rtc_base/task_queue.h +++ b/webrtc/rtc_base/task_queue.h @@ -149,7 +149,7 @@ static std::unique_ptr NewClosure(const Closure& closure, // TaskQueue itself has been deleted or it may happen synchronously while the // TaskQueue instance is being deleted. This may vary from one OS to the next // so assumptions about lifetimes of pending tasks should not be made. -class LOCKABLE TaskQueue { +class RTC_LOCKABLE TaskQueue { public: // TaskQueue priority levels. On some platforms these will map to thread // priorities, on others such as Mac and iOS, GCD queue priorities. diff --git a/webrtc/rtc_base/task_queue_libevent.cc b/webrtc/rtc_base/task_queue_libevent.cc index 2c60e9ee60..17da0f094d 100644 --- a/webrtc/rtc_base/task_queue_libevent.cc +++ b/webrtc/rtc_base/task_queue_libevent.cc @@ -150,9 +150,9 @@ class TaskQueue::Impl : public RefCountInterface { std::unique_ptr wakeup_event_; PlatformThread thread_; rtc::CriticalSection pending_lock_; - std::list> pending_ GUARDED_BY(pending_lock_); + std::list> pending_ RTC_GUARDED_BY(pending_lock_); std::list> pending_replies_ - GUARDED_BY(pending_lock_); + RTC_GUARDED_BY(pending_lock_); }; struct TaskQueue::Impl::QueueContext { diff --git a/webrtc/rtc_base/thread.h b/webrtc/rtc_base/thread.h index f037d8a7ac..d072fac09b 100644 --- a/webrtc/rtc_base/thread.h +++ b/webrtc/rtc_base/thread.h @@ -100,7 +100,7 @@ class Runnable { // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). -class LOCKABLE Thread : public MessageQueue { +class RTC_LOCKABLE Thread : public MessageQueue { public: // DEPRECATED. // The default constructor should not be used because it hides whether or diff --git a/webrtc/rtc_base/thread_checker.h b/webrtc/rtc_base/thread_checker.h index 70daf5a0fe..769b7f0565 100644 --- a/webrtc/rtc_base/thread_checker.h +++ b/webrtc/rtc_base/thread_checker.h @@ -71,22 +71,20 @@ class ThreadCheckerDoNothing { // // In Release mode, CalledOnValidThread will always return true. #if ENABLE_THREAD_CHECKER -class LOCKABLE ThreadChecker : public ThreadCheckerImpl { -}; +class RTC_LOCKABLE ThreadChecker : public ThreadCheckerImpl {}; #else -class LOCKABLE ThreadChecker : public ThreadCheckerDoNothing { -}; +class RTC_LOCKABLE ThreadChecker : public ThreadCheckerDoNothing {}; #endif // ENABLE_THREAD_CHECKER #undef ENABLE_THREAD_CHECKER namespace internal { -class SCOPED_LOCKABLE AnnounceOnThread { +class RTC_SCOPED_LOCKABLE AnnounceOnThread { public: - template + template explicit AnnounceOnThread(const ThreadLikeObject* thread_like_object) - EXCLUSIVE_LOCK_FUNCTION(thread_like_object) {} - ~AnnounceOnThread() UNLOCK_FUNCTION() {} + RTC_EXCLUSIVE_LOCK_FUNCTION(thread_like_object) {} + ~AnnounceOnThread() RTC_UNLOCK_FUNCTION() {} template static bool IsCurrent(const ThreadLikeObject* thread_like_object) { diff --git a/webrtc/rtc_base/thread_unittest.cc b/webrtc/rtc_base/thread_unittest.cc index e7701e84b3..7631f5eba9 100644 --- a/webrtc/rtc_base/thread_unittest.cc +++ b/webrtc/rtc_base/thread_unittest.cc @@ -336,7 +336,7 @@ TEST(ThreadTest, ThreeThreadsInvoke) { private: CriticalSection crit_; - bool value_ GUARDED_BY(crit_); + bool value_ RTC_GUARDED_BY(crit_); }; struct LocalFuncs {