diff --git a/xpcom/threads/nsThreadPool.h b/xpcom/threads/nsThreadPool.h index a8b8425bcdb9..006037c3eaad 100644 --- a/xpcom/threads/nsThreadPool.h +++ b/xpcom/threads/nsThreadPool.h @@ -36,21 +36,22 @@ class nsThreadPool final : public mozilla::Runnable, public nsIThreadPool { nsresult PutEvent(nsIRunnable* aEvent); nsresult PutEvent(already_AddRefed aEvent, uint32_t aFlags); - nsCOMArray mThreads; - mozilla::Mutex mMutex MOZ_UNANNOTATED; - mozilla::CondVar mEventsAvailable; - mozilla::EventQueue mEvents; - uint32_t mThreadLimit; - uint32_t mIdleThreadLimit; - uint32_t mIdleThreadTimeout; - uint32_t mIdleCount; - uint32_t mStackSize; - nsCOMPtr mListener; - bool mShutdown; - bool mRegressiveMaxIdleTime; + mozilla::Mutex mMutex; + nsCOMArray mThreads GUARDED_BY(mMutex); + mozilla::CondVar mEventsAvailable GUARDED_BY(mMutex); + mozilla::EventQueue mEvents GUARDED_BY(mMutex); + uint32_t mThreadLimit GUARDED_BY(mMutex); + uint32_t mIdleThreadLimit GUARDED_BY(mMutex); + uint32_t mIdleThreadTimeout GUARDED_BY(mMutex); + uint32_t mIdleCount GUARDED_BY(mMutex); + uint32_t mStackSize GUARDED_BY(mMutex); + nsCOMPtr mListener GUARDED_BY(mMutex); + mozilla::Atomic mShutdown; + bool mRegressiveMaxIdleTime GUARDED_BY(mMutex); mozilla::Atomic mIsAPoolThreadFree; - nsCString mName; - nsThreadPoolNaming mThreadNaming; + // set once before we start threads + nsCString mName GUARDED_BY(mMutex); + nsThreadPoolNaming mThreadNaming; // all data inside this is atomic }; #define NS_THREADPOOL_CID \