diff --git a/accessible/ipc/win/HandlerProvider.h b/accessible/ipc/win/HandlerProvider.h index f517a0f9919c..bfaa58667d33 100644 --- a/accessible/ipc/win/HandlerProvider.h +++ b/accessible/ipc/win/HandlerProvider.h @@ -115,7 +115,7 @@ class HandlerProvider final : public IGeckoBackChannel, HRESULT* result); Atomic mRefCnt; - Mutex mMutex MOZ_UNANNOTATED; // Protects mSerializer + Mutex mMutex; // Protects mSerializer const IID mTargetUnkIid; mscom::InterceptorTargetPtr mTargetUnk; // Constant, main thread only @@ -136,7 +136,7 @@ class HandlerProvider final : public IGeckoBackChannel, // Used when the payload is built prior to marshaling the object by a bulk // fetch operation. See prebuildPayload(). IA2PayloadPtr mPayload; - Mutex mPayloadMutex MOZ_UNANNOTATED; // Protects mPayload + Mutex mPayloadMutex; // Protects mPayload }; } // namespace a11y diff --git a/docshell/base/timeline/MarkersStorage.h b/docshell/base/timeline/MarkersStorage.h index ee401bdcabcd..746a02e4ec42 100644 --- a/docshell/base/timeline/MarkersStorage.h +++ b/docshell/base/timeline/MarkersStorage.h @@ -40,7 +40,7 @@ class MarkersStorage : public LinkedListElement { Mutex& GetLock(); private: - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; }; } // namespace mozilla diff --git a/docshell/base/timeline/TimelineConsumers.h b/docshell/base/timeline/TimelineConsumers.h index 7b2b6669c244..8ce995356243 100644 --- a/docshell/base/timeline/TimelineConsumers.h +++ b/docshell/base/timeline/TimelineConsumers.h @@ -123,7 +123,7 @@ class TimelineConsumers : public nsIObserver { LinkedList mMarkersStores; // Protects this class's data structures. - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; }; } // namespace mozilla diff --git a/dom/base/BodyStream.h b/dom/base/BodyStream.h index 6328617b3efd..80918bdce572 100644 --- a/dom/base/BodyStream.h +++ b/dom/base/BodyStream.h @@ -227,7 +227,7 @@ class BodyStream final : public nsIInputStreamCallback, // We need a mutex because JS engine can release BodyStream on a non-owning // thread. We must be sure that the releasing of resources doesn't trigger // race conditions. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Protected by mutex. State mState; diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp index 04216b89fe79..366f49181288 100644 --- a/dom/cache/Manager.cpp +++ b/dom/cache/Manager.cpp @@ -1101,7 +1101,7 @@ class Manager::CachePutAllAction final : public DBAction { nsTArray mDeletedBodyIdList; // accessed from any thread while mMutex locked - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsTArray> mCopyContextList; Maybe mDirectoryMetadata; diff --git a/dom/cache/ReadStream.cpp b/dom/cache/ReadStream.cpp index 478d791ccd63..3de6561d341e 100644 --- a/dom/cache/ReadStream.cpp +++ b/dom/cache/ReadStream.cpp @@ -105,7 +105,7 @@ class ReadStream::Inner final : public ReadStream::Controllable { // to close a stream on our owning thread while an IO thread is simultaneously // reading the same stream. Therefore, protect all access to these stream // objects with a mutex. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; CondVar mCondVar; nsCOMPtr mStream; nsCOMPtr mSnappyStream; diff --git a/dom/canvas/HostWebGLContext.cpp b/dom/canvas/HostWebGLContext.cpp index 36029e33ed55..9d0b47d9a03e 100644 --- a/dom/canvas/HostWebGLContext.cpp +++ b/dom/canvas/HostWebGLContext.cpp @@ -32,7 +32,7 @@ namespace mozilla { // - -static StaticMutex sContextSetLock MOZ_UNANNOTATED; +static StaticMutex sContextSetLock; static std::unordered_set& DeferredStaticContextSet() { static std::unordered_set sContextSet; diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index ff37dcdbacc3..acc7c19df562 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -1475,7 +1475,7 @@ class CreateImageBitmapFromBlob final : public DiscardableRunnable, // This is called on the main-thread only. nsresult GetMimeTypeAsync(); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // The access to this object is protected by mutex but is always nullified on // the owning thread. diff --git a/dom/canvas/OffscreenCanvasDisplayHelper.h b/dom/canvas/OffscreenCanvasDisplayHelper.h index 970f8c4be5d2..a98396685c12 100644 --- a/dom/canvas/OffscreenCanvasDisplayHelper.h +++ b/dom/canvas/OffscreenCanvasDisplayHelper.h @@ -62,7 +62,7 @@ class OffscreenCanvasDisplayHelper final { gfx::SurfaceFormat aFormat, const gfx::IntSize& aSize, bool aNeedsPremult, gl::OriginPos aOriginPos) const; - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; HTMLCanvasElement* MOZ_NON_OWNING_REF mCanvasElement; RefPtr mImageContainer; RefPtr mFrontBufferSurface; diff --git a/dom/console/ConsoleReportCollector.h b/dom/console/ConsoleReportCollector.h index fc82a65bda6a..de8900c4e880 100644 --- a/dom/console/ConsoleReportCollector.h +++ b/dom/console/ConsoleReportCollector.h @@ -78,7 +78,7 @@ class ConsoleReportCollector final : public nsIConsoleReportCollector { const CopyableTArray mStringParams; }; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // protected by mMutex nsTArray mPendingReports; diff --git a/dom/file/FileBlobImpl.h b/dom/file/FileBlobImpl.h index 7a031747fc73..9f512d81333c 100644 --- a/dom/file/FileBlobImpl.h +++ b/dom/file/FileBlobImpl.h @@ -131,7 +131,7 @@ class FileBlobImpl : public BlobImpl { // FileBlobImpl has getter methods with lazy initialization. Because any // BlobImpl must work thread-safe, we use a mutex. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsCOMPtr mFile; diff --git a/dom/file/MemoryBlobImpl.h b/dom/file/MemoryBlobImpl.h index 3bb9b7c7fcd9..f1279e395c9e 100644 --- a/dom/file/MemoryBlobImpl.h +++ b/dom/file/MemoryBlobImpl.h @@ -97,7 +97,7 @@ class MemoryBlobImpl final : public BaseBlobImpl { // sDataOwners and sMemoryReporterRegistered may only be accessed while // holding sDataOwnerMutex! You also must hold the mutex while touching // elements of the linked list that DataOwner inherits from. - static mozilla::StaticMutex sDataOwnerMutex MOZ_UNANNOTATED; + static mozilla::StaticMutex sDataOwnerMutex; static mozilla::StaticAutoPtr > sDataOwners; static bool sMemoryReporterRegistered; diff --git a/dom/file/MutableBlobStorage.h b/dom/file/MutableBlobStorage.h index aa0d42c75ecd..6bacaa9de42e 100644 --- a/dom/file/MutableBlobStorage.h +++ b/dom/file/MutableBlobStorage.h @@ -92,7 +92,7 @@ class MutableBlobStorage final { [[nodiscard]] nsresult DispatchToIOThread( already_AddRefed aRunnable); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // All these variables are touched on the main thread only or in the // retargeted thread when used by Append(). They are protected by mMutex. diff --git a/dom/file/ipc/RemoteLazyInputStream.h b/dom/file/ipc/RemoteLazyInputStream.h index 7044facc4e3b..c36f63f4ab82 100644 --- a/dom/file/ipc/RemoteLazyInputStream.h +++ b/dom/file/ipc/RemoteLazyInputStream.h @@ -115,7 +115,7 @@ class RemoteLazyInputStream final : public nsIAsyncInputStream, // Any member of this class is protected by mutex because touched on // multiple threads. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; } // namespace mozilla diff --git a/dom/file/ipc/RemoteLazyInputStreamChild.h b/dom/file/ipc/RemoteLazyInputStreamChild.h index a91c19c499a8..7e86a90ac85a 100644 --- a/dom/file/ipc/RemoteLazyInputStreamChild.h +++ b/dom/file/ipc/RemoteLazyInputStreamChild.h @@ -78,7 +78,7 @@ class RemoteLazyInputStreamChild final : public PRemoteLazyInputStreamChild { nsTArray mStreams; // This mutex protects mStreams because that can be touched in any thread. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; const nsID mID; const uint64_t mSize; diff --git a/dom/file/uri/BlobURLInputStream.h b/dom/file/uri/BlobURLInputStream.h index 0ddf4fab5e5c..98d104b2578e 100644 --- a/dom/file/uri/BlobURLInputStream.h +++ b/dom/file/uri/BlobURLInputStream.h @@ -60,7 +60,7 @@ class BlobURLInputStream final : public nsIAsyncInputStream, // Non-recursive mutex introduced in order to guard access to mState, mError // and mAsyncInputStream - Mutex mStateMachineMutex MOZ_UNANNOTATED; + Mutex mStateMachineMutex; State mState; // Stores the error code if stream is in error state nsresult mError; diff --git a/dom/file/uri/BlobURLProtocolHandler.cpp b/dom/file/uri/BlobURLProtocolHandler.cpp index 14f813b7d437..a1bcead17bc3 100644 --- a/dom/file/uri/BlobURLProtocolHandler.cpp +++ b/dom/file/uri/BlobURLProtocolHandler.cpp @@ -87,7 +87,7 @@ struct DataInfo { // The mutex is locked whenever gDataTable is changed, or if gDataTable // is accessed off-main-thread. -static StaticMutex sMutex MOZ_UNANNOTATED; +static StaticMutex sMutex; // All changes to gDataTable must happen on the main thread, while locking // sMutex. Reading from gDataTable on the main thread may happen without diff --git a/dom/filesystem/GetFilesHelper.h b/dom/filesystem/GetFilesHelper.h index def05767192f..8591526be3a4 100644 --- a/dom/filesystem/GetFilesHelper.h +++ b/dom/filesystem/GetFilesHelper.h @@ -118,7 +118,7 @@ class GetFilesHelper : public Runnable, public GetFilesHelperBase { nsTArray> mPromises; nsTArray> mCallbacks; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // This variable is protected by mutex. bool mCanceled; diff --git a/dom/gamepad/GamepadPlatformService.h b/dom/gamepad/GamepadPlatformService.h index 8679cce76d37..3d7a6a9b922c 100644 --- a/dom/gamepad/GamepadPlatformService.h +++ b/dom/gamepad/GamepadPlatformService.h @@ -141,7 +141,7 @@ class GamepadPlatformService final { // This mutex protects mChannelParents from race condition // between background and monitor thread - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; std::map mGamepadAdded; }; diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index af677ab21a5c..4fee345d6593 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -1497,7 +1497,7 @@ class ConnectionPool final { }; // This mutex guards mDatabases, see below. - Mutex mDatabasesMutex MOZ_UNANNOTATED; + Mutex mDatabasesMutex; nsTArray mIdleThreads; nsTArray mIdleDatabases; @@ -6592,7 +6592,7 @@ nsresult DispatchAndReturnFileReferences( *aMemRefCnt = -1; *aDBRefCnt = -1; - mozilla::Monitor monitor MOZ_ANNOTATED(__func__); + mozilla::Monitor monitor(__func__); bool waiting = true; auto lambda = [&] { @@ -6758,7 +6758,7 @@ class DeserializeIndexValueHelper final : public Runnable { lock.Notify(); } - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; const int64_t mIndexID; const KeyPath& mKeyPath; @@ -21682,7 +21682,7 @@ class FileHelper::ReadCallback final : public nsIInputStreamCallback { private: ~ReadCallback() = default; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; mozilla::CondVar mCondVar; bool mInputAvailable; }; diff --git a/dom/indexedDB/SchemaUpgrades.cpp b/dom/indexedDB/SchemaUpgrades.cpp index 5c749810b1bd..f65c67dd8672 100644 --- a/dom/indexedDB/SchemaUpgrades.cpp +++ b/dom/indexedDB/SchemaUpgrades.cpp @@ -2842,7 +2842,7 @@ class DeserializeUpgradeValueHelper final : public Runnable { lock.Notify(); } - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; StructuredCloneReadInfoParent& mCloneReadInfo; nsresult mStatus; }; diff --git a/dom/ipc/ProcessHangMonitor.cpp b/dom/ipc/ProcessHangMonitor.cpp index 08d9abf377df..1f10dec122e0 100644 --- a/dom/ipc/ProcessHangMonitor.cpp +++ b/dom/ipc/ProcessHangMonitor.cpp @@ -148,7 +148,7 @@ class HangMonitorChild : public PProcessHangMonitorChild, static Atomic sInstance; const RefPtr mHangMonitor; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; // Main thread-only. bool mSentReport; @@ -282,7 +282,7 @@ class HangMonitorParent : public PProcessHangMonitorParent, // This field is only accessed on the hang thread. bool mIPCOpen; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; // Must be accessed with mMonitor held. RefPtr mProcess; @@ -290,7 +290,7 @@ class HangMonitorParent : public PProcessHangMonitorParent, // Map from plugin ID to crash dump ID. Protected by // mBrowserCrashDumpHashLock. nsTHashMap mBrowserCrashDumpIds; - Mutex mBrowserCrashDumpHashLock MOZ_UNANNOTATED; + Mutex mBrowserCrashDumpHashLock; mozilla::ipc::TaskFactory mMainThreadTaskFactory; }; diff --git a/dom/ipc/RefMessageBodyService.h b/dom/ipc/RefMessageBodyService.h index 6cca2a836efa..ac4aff172276 100644 --- a/dom/ipc/RefMessageBodyService.h +++ b/dom/ipc/RefMessageBodyService.h @@ -96,7 +96,7 @@ class RefMessageBody final { // In case the RefMessageBody is shared and refcounted (see mCount/mMaxCount), // we must enforce that the reading does not happen simultaneously on // different threads. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; UniquePtr mCloneData; diff --git a/dom/localstorage/ActorsParent.cpp b/dom/localstorage/ActorsParent.cpp index d9ca5e6393f6..477a88c24385 100644 --- a/dom/localstorage/ActorsParent.cpp +++ b/dom/localstorage/ActorsParent.cpp @@ -1368,7 +1368,7 @@ class Connection final : public CachingDatabaseConnection { * origin, so we need to queue a runnable and wait our turn.) */ class Connection::InitTemporaryOriginHelper final : public Runnable { - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; const OriginMetadata mOriginMetadata; nsString mOriginDirectoryPath; nsresult mIOThreadResultCode; @@ -2614,7 +2614,7 @@ class QuotaClient final : public mozilla::dom::quota::Client { static QuotaClient* sInstance; - Mutex mShadowDatabaseMutex MOZ_UNANNOTATED; + Mutex mShadowDatabaseMutex; bool mShutdownRequested; public: diff --git a/dom/media/AudioStream.h b/dom/media/AudioStream.h index 964ff1c47306..01765e9f90f2 100644 --- a/dom/media/AudioStream.h +++ b/dom/media/AudioStream.h @@ -329,7 +329,7 @@ class AudioStream final { soundtouch::SoundTouch* mTimeStretcher; // The monitor is held to protect all access to member variables below. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; const uint32_t mOutChannels; const AudioConfig::ChannelLayout::ChannelMap mChannelMap; diff --git a/dom/media/Benchmark.cpp b/dom/media/Benchmark.cpp index 6b2af7a3a100..14ab45212964 100644 --- a/dom/media/Benchmark.cpp +++ b/dom/media/Benchmark.cpp @@ -79,7 +79,7 @@ bool VP9Benchmark::IsVP9DecodeFast(bool aDefault) { if (!ShouldRun()) { return false; } - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; uint32_t decodeFps = StaticPrefs::media_benchmark_vp9_fps(); uint32_t hadRecentUpdate = StaticPrefs::media_benchmark_vp9_versioncheck(); bool needBenchmark; diff --git a/dom/media/ChannelMediaResource.h b/dom/media/ChannelMediaResource.h index bd1b83b5a81e..1de692ca8997 100644 --- a/dom/media/ChannelMediaResource.h +++ b/dom/media/ChannelMediaResource.h @@ -186,7 +186,7 @@ class ChannelMediaResource void Revoke(); private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // mResource should only be modified on the main thread with the lock. // So it can be read without lock on the main thread or on other threads // with the lock. diff --git a/dom/media/CloneableWithRangeMediaResource.cpp b/dom/media/CloneableWithRangeMediaResource.cpp index 4faac6125fd4..c1facd86392a 100644 --- a/dom/media/CloneableWithRangeMediaResource.cpp +++ b/dom/media/CloneableWithRangeMediaResource.cpp @@ -113,7 +113,7 @@ class InputStreamReader final : public nsIInputStreamCallback { nsCOMPtr mStream; nsCOMPtr mAsyncStream; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; }; NS_IMPL_ADDREF(InputStreamReader); diff --git a/dom/media/FileBlockCache.h b/dom/media/FileBlockCache.h index 7773997e33aa..3108d603dfcb 100644 --- a/dom/media/FileBlockCache.h +++ b/dom/media/FileBlockCache.h @@ -140,7 +140,7 @@ class FileBlockCache : public MediaBlockCacheBase { // Mutex which controls access to mFD and mFDCurrentPos. Don't hold // mDataMutex while holding mFileMutex! mFileMutex must be owned // while accessing any of the following data fields or methods. - Mutex mFileMutex MOZ_UNANNOTATED; + Mutex mFileMutex; // Moves a block already committed to file. nsresult MoveBlockInFile(int32_t aSourceBlockIndex, int32_t aDestBlockIndex); // Seeks file pointer. @@ -159,7 +159,7 @@ class FileBlockCache : public MediaBlockCacheBase { // and mFDCurrentPos. Don't hold mDataMutex while holding mFileMutex! // mDataMutex must be owned while accessing any of the following data // fields or methods. - Mutex mDataMutex MOZ_UNANNOTATED; + Mutex mDataMutex; // Ensures we either are running the event to preform IO, or an event // has been dispatched to preform the IO. // mDataMutex must be owned while calling this. diff --git a/dom/media/FileMediaResource.h b/dom/media/FileMediaResource.h index f1ebf5b948b9..d34f522ed892 100644 --- a/dom/media/FileMediaResource.h +++ b/dom/media/FileMediaResource.h @@ -109,7 +109,7 @@ class FileMediaResource : public BaseMediaResource { // Read or Seek is in progress since it resets various internal // values to null. // This lock protects mSeekable, mInput, mSize, and mSizeInitialized. - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; // Seekable stream interface to file. This can be used from any // thread. diff --git a/dom/media/FrameStatistics.h b/dom/media/FrameStatistics.h index 6a85a412316f..ed0cd31229ce 100644 --- a/dom/media/FrameStatistics.h +++ b/dom/media/FrameStatistics.h @@ -171,7 +171,7 @@ class FrameStatistics { ~FrameStatistics() = default; // ReentrantMonitor to protect access of playback statistics. - mutable ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + mutable ReentrantMonitor mReentrantMonitor; FrameStatisticsData mFrameStatisticsData; }; diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 7cd21ac8f3c7..5f191de8967b 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -377,7 +377,7 @@ class MediaTrackGraphInitThreadRunnable; */ class ThreadedDriver : public GraphDriver { class IterationWaitHelper { - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; // The below members are guarded by mMonitor. bool mNeedAnotherIteration = false; TimeStamp mWakeTime; diff --git a/dom/media/GraphRunner.h b/dom/media/GraphRunner.h index 1a8f879ef6ae..8a5a60fb6306 100644 --- a/dom/media/GraphRunner.h +++ b/dom/media/GraphRunner.h @@ -80,7 +80,7 @@ class GraphRunner final : public Runnable { // Monitor used for yielding mThread through Wait(), and scheduling mThread // through Signal() from a GraphDriver. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; // The MediaTrackGraph we're running. Weakptr beecause this graph owns us and // guarantees that our lifetime will not go beyond that of itself. MediaTrackGraphImpl* const mGraph; diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index 41d51a49cc0f..62f10a4f613e 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -443,7 +443,7 @@ class MediaCache { // The monitor protects all the data members here. Also, off-main-thread // readers that need to block will Wait() on this monitor. When new // data becomes available in the cache, we NotifyAll() on this monitor. - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; // This must always be accessed when the monitor is held. nsTArray mStreams; // The Blocks describing the cache entries. diff --git a/dom/media/MediaEventSource.h b/dom/media/MediaEventSource.h index 27198b11a22b..8115ffa7c936 100644 --- a/dom/media/MediaEventSource.h +++ b/dom/media/MediaEventSource.h @@ -475,7 +475,7 @@ class MediaEventSourceImpl { } private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsTArray> mListeners; }; diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index f02c0e7c84e6..11ffd96c8fce 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -718,7 +718,7 @@ class MediaFormatReader::DemuxerProxy::Wrapper : public MediaTrackDemuxer { void BreakCycles() override {} private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; const RefPtr mTaskQueue; const bool mGetSamplesMayBlock; const UniquePtr mInfo; diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index fc6a353316cb..912125cad270 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -392,7 +392,7 @@ class MediaFormatReader final // as those can be read outside the TaskQueue. // They are only written on the TaskQueue however, as such mMutex doesn't // need to be held when those members are read on the TaskQueue. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // The platform decoder. RefPtr mDecoder; nsCString mDescription; diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h index a3dba9ec2bb2..2ca86203134c 100644 --- a/dom/media/MediaManager.h +++ b/dom/media/MediaManager.h @@ -391,7 +391,7 @@ class MediaManager final : public nsIMediaManagerService, RefPtr mBackend; static StaticRefPtr sSingleton; - static StaticMutex sSingletonMutex MOZ_UNANNOTATED; + static StaticMutex sSingletonMutex; // Connect/Disconnect on media thread only MediaEventListener mDeviceListChangeListener; diff --git a/dom/media/MediaQueue.h b/dom/media/MediaQueue.h index 3fd9049fb9f4..06f7c99df763 100644 --- a/dom/media/MediaQueue.h +++ b/dom/media/MediaQueue.h @@ -179,7 +179,7 @@ class MediaQueue : private nsRefPtrDeque { } } - mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED; + mutable RecursiveMutex mRecursiveMutex; MediaEventProducer> mPopFrontEvent; MediaEventProducer> mPushEvent; MediaEventProducer mFinishEvent; diff --git a/dom/media/MediaTimer.h b/dom/media/MediaTimer.h index 837a1591b367..3636c2cc9eba 100644 --- a/dom/media/MediaTimer.h +++ b/dom/media/MediaTimer.h @@ -95,7 +95,7 @@ class MediaTimer { nsCOMPtr mThread; std::priority_queue mEntries; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; nsCOMPtr mTimer; TimeStamp mCurrentTimerTarget; diff --git a/dom/media/MediaTrackGraph.h b/dom/media/MediaTrackGraph.h index d9a76617a982..5b26bdda4c75 100644 --- a/dom/media/MediaTrackGraph.h +++ b/dom/media/MediaTrackGraph.h @@ -733,7 +733,7 @@ class SourceMediaTrack : public MediaTrack { // This must be acquired *before* MediaTrackGraphImpl's lock, if they are // held together. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // protected by mMutex float mVolume = 1.0; UniquePtr mUpdateTrack; diff --git a/dom/media/MediaTrackGraphImpl.h b/dom/media/MediaTrackGraphImpl.h index e523b52abbde..1ce98709119b 100644 --- a/dom/media/MediaTrackGraphImpl.h +++ b/dom/media/MediaTrackGraphImpl.h @@ -767,7 +767,7 @@ class MediaTrackGraphImpl : public MediaTrackGraph, // not safe to just grab mMonitor from some thread and start monkeying with // the graph. Instead, communicate with the graph thread using provided // mechanisms such as the ControlMessage queue. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; // Data guarded by mMonitor (must always be accessed with mMonitor held, // regardless of the value of mLifecycleState). diff --git a/dom/media/MemoryBlockCache.h b/dom/media/MemoryBlockCache.h index 32bf9615c6c8..abebb5125e72 100644 --- a/dom/media/MemoryBlockCache.h +++ b/dom/media/MemoryBlockCache.h @@ -76,7 +76,7 @@ class MemoryBlockCache : public MediaBlockCacheBase { const size_t mMaxBlocks; // Mutex which controls access to all members below. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsTArray mBuffer; bool mHasGrown = false; diff --git a/dom/media/VideoFrameContainer.h b/dom/media/VideoFrameContainer.h index efa1ad8491cf..3b3621fdcf07 100644 --- a/dom/media/VideoFrameContainer.h +++ b/dom/media/VideoFrameContainer.h @@ -117,7 +117,7 @@ class VideoFrameContainer { } mMainThreadState; // mMutex protects all the fields below. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // The intrinsic size is the ideal size which we should render the // ImageContainer's current Image at. // This can differ from the Image's actual size when the media resource diff --git a/dom/media/VideoOutput.h b/dom/media/VideoOutput.h index 2eb81faa82fc..14982caedd5d 100644 --- a/dom/media/VideoOutput.h +++ b/dom/media/VideoOutput.h @@ -213,7 +213,7 @@ class VideoOutput : public DirectMediaTrackListener { } } - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; TimeStamp mLastFrameTime; // Once the frame is forced to black, we initialize mBlackImage for use in any // following forced-black frames. diff --git a/dom/media/doctor/DDMediaLogs.h b/dom/media/doctor/DDMediaLogs.h index ef5bbe98f901..059ccc3968d5 100644 --- a/dom/media/doctor/DDMediaLogs.h +++ b/dom/media/doctor/DDMediaLogs.h @@ -175,7 +175,7 @@ struct DDMediaLogs { nsTArray mObjectLinks; // Protects members below. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Processing thread. nsCOMPtr mThread; diff --git a/dom/media/doctor/MultiWriterQueue.h b/dom/media/doctor/MultiWriterQueue.h index 82cc5c18b04e..57ecc5d5ab9e 100644 --- a/dom/media/doctor/MultiWriterQueue.h +++ b/dom/media/doctor/MultiWriterQueue.h @@ -28,7 +28,7 @@ class MultiWriterQueueReaderLocking_Mutex { void Unlock() { mMutex.Unlock(); }; private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; // Reader non-locking strategy, trusting that PopAll will never be called diff --git a/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp b/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp index 0c1ea6235c98..f189738ea471 100644 --- a/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp +++ b/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp @@ -330,7 +330,7 @@ struct DequeWrapperAW : DequeWrapperST { // Multi-thread writes allowed, make sure you don't pop unless writes can't // happen. struct DequeWrapperMW : DequeWrapperST { - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; DequeWrapperMW() : mMutex("DequeWrapperMW/MT") {} diff --git a/dom/media/gmp/ChromiumCDMProxy.h b/dom/media/gmp/ChromiumCDMProxy.h index 0f5c3f817f59..28d0905380ec 100644 --- a/dom/media/gmp/ChromiumCDMProxy.h +++ b/dom/media/gmp/ChromiumCDMProxy.h @@ -131,7 +131,7 @@ class ChromiumCDMProxy : public CDMProxy { RefPtr mCrashHelper; - Mutex mCDMMutex MOZ_UNANNOTATED; + Mutex mCDMMutex; RefPtr mCDM; nsCOMPtr mGMPThread; UniquePtr mCallback; diff --git a/dom/media/gmp/GMPPlatform.cpp b/dom/media/gmp/GMPPlatform.cpp index fa802006a8b2..3075c43d5422 100644 --- a/dom/media/gmp/GMPPlatform.cpp +++ b/dom/media/gmp/GMPPlatform.cpp @@ -86,7 +86,7 @@ class GMPSyncRunnable final { bool mDone; GMPTask* mTask; MessageLoop* mMessageLoop; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; }; class GMPThreadImpl : public GMPThread { @@ -99,7 +99,7 @@ class GMPThreadImpl : public GMPThread { void Join() override; private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; base::Thread mThread; }; @@ -148,7 +148,7 @@ class GMPMutexImpl : public GMPMutex { void Destroy() override; private: - ReentrantMonitor mMonitor MOZ_UNANNOTATED; + ReentrantMonitor mMonitor; }; GMPErr CreateMutex(GMPMutex** aMutex) { diff --git a/dom/media/gmp/GMPService.h b/dom/media/gmp/GMPService.h index 33e7801e2a0e..ff9899669e33 100644 --- a/dom/media/gmp/GMPService.h +++ b/dom/media/gmp/GMPService.h @@ -106,9 +106,8 @@ class GeckoMediaPluginService : public mozIGeckoMediaPluginService, static nsCOMPtr GetShutdownBarrier(); - Mutex mMutex MOZ_UNANNOTATED; // Protects mGMPThread, mPluginCrashHelpers, - // mGMPThreadShutdown and some members in - // derived classes. + Mutex mMutex; // Protects mGMPThread, mPluginCrashHelpers, + // mGMPThreadShutdown and some members in derived classes. const nsCOMPtr mMainThread; diff --git a/dom/media/gmp/GMPServiceParent.h b/dom/media/gmp/GMPServiceParent.h index 2ebcc020ee43..7b0a556ba2c2 100644 --- a/dom/media/gmp/GMPServiceParent.h +++ b/dom/media/gmp/GMPServiceParent.h @@ -211,7 +211,7 @@ class GeckoMediaPluginServiceParent final // Synchronization for barrier that ensures we've loaded GMPs from // MOZ_GMP_PATH before allowing GetContentParentFrom() to proceed. - Monitor mInitPromiseMonitor MOZ_UNANNOTATED; + Monitor mInitPromiseMonitor; MozMonitoredPromiseHolder mInitPromise; bool mLoadPluginsFromDiskComplete; diff --git a/dom/media/gmp/GMPStorageChild.h b/dom/media/gmp/GMPStorageChild.h index 5deecc991e26..cf6b30e53567 100644 --- a/dom/media/gmp/GMPStorageChild.h +++ b/dom/media/gmp/GMPStorageChild.h @@ -84,7 +84,7 @@ class GMPStorageChild : public PGMPStorageChild { mozilla::ipc::IPCResult RecvShutdown(); private: - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; nsRefPtrHashtable mRecords; GMPChild* mPlugin; bool mShutdown; diff --git a/dom/media/gtest/MockCubeb.h b/dom/media/gtest/MockCubeb.h index 63ea90c7330b..e3b3d47f4cd4 100644 --- a/dom/media/gtest/MockCubeb.h +++ b/dom/media/gtest/MockCubeb.h @@ -182,7 +182,7 @@ class MockCubebStream { private: // Monitor used to block start until mFrozenStart is false. - Monitor mFrozenStartMonitor MOZ_UNANNOTATED; + Monitor mFrozenStartMonitor; // Whether this stream should wait for an explicit start request before // starting. Protected by FrozenStartMonitor. bool mFrozenStart; diff --git a/dom/media/gtest/TestCDMStorage.cpp b/dom/media/gtest/TestCDMStorage.cpp index b4bc3644fb8b..ab081b5b24c6 100644 --- a/dom/media/gtest/TestCDMStorage.cpp +++ b/dom/media/gtest/TestCDMStorage.cpp @@ -1150,7 +1150,7 @@ class CDMStorageTest { nsTArray mExpected; RefPtr mCDM; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; Atomic mFinished; nsCString mNodeId; diff --git a/dom/media/gtest/TestWebMBuffered.cpp b/dom/media/gtest/TestWebMBuffered.cpp index 0da040371dd3..14f5ae2b2591 100644 --- a/dom/media/gtest/TestWebMBuffered.cpp +++ b/dom/media/gtest/TestWebMBuffered.cpp @@ -21,7 +21,7 @@ static const int64_t gEndOffsets[] = {501, 772, 1244, 1380, 1543, 2015}; TEST(WebMBuffered, BasicTests) { - ReentrantMonitor dummy MOZ_UNANNOTATED("dummy"); + ReentrantMonitor dummy("dummy"); WebMBufferedParser parser(0); nsTArray mapping; @@ -60,7 +60,7 @@ static void ReadFile(const char* aPath, nsTArray& aBuffer) { TEST(WebMBuffered, RealData) { - ReentrantMonitor dummy MOZ_UNANNOTATED("dummy"); + ReentrantMonitor dummy("dummy"); WebMBufferedParser parser(0); nsTArray webmData; @@ -82,7 +82,7 @@ TEST(WebMBuffered, RealData) TEST(WebMBuffered, RealDataAppend) { - ReentrantMonitor dummy MOZ_UNANNOTATED("dummy"); + ReentrantMonitor dummy("dummy"); WebMBufferedParser parser(0); nsTArray mapping; diff --git a/dom/media/hls/HLSDecoder.cpp b/dom/media/hls/HLSDecoder.cpp index 792654f16c21..ebcdfb7d3a37 100644 --- a/dom/media/hls/HLSDecoder.cpp +++ b/dom/media/hls/HLSDecoder.cpp @@ -44,7 +44,7 @@ class HLSResourceCallbacksSupport private: ~HLSResourceCallbacksSupport() {} - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; HLSDecoder* mDecoder; }; diff --git a/dom/media/hls/HLSDemuxer.cpp b/dom/media/hls/HLSDemuxer.cpp index 1827467b639c..24e79cbf11a6 100644 --- a/dom/media/hls/HLSDemuxer.cpp +++ b/dom/media/hls/HLSDemuxer.cpp @@ -119,7 +119,7 @@ class HLSDemuxer::HLSDemuxerCallbacksSupport mDemuxer = nullptr; } - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; private: ~HLSDemuxerCallbacksSupport() {} diff --git a/dom/media/hls/HLSDemuxer.h b/dom/media/hls/HLSDemuxer.h index 1a3e26c1f37b..4813eaafb2be 100644 --- a/dom/media/hls/HLSDemuxer.h +++ b/dom/media/hls/HLSDemuxer.h @@ -127,7 +127,7 @@ class HLSTrackDemuxer : public MediaTrackDemuxer, RefPtr mQueuedSample; // Mutex to protect members below across multiple threads. - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; UniquePtr mTrackInfo; }; diff --git a/dom/media/mediasource/ContainerParser.cpp b/dom/media/mediasource/ContainerParser.cpp index 35a7cfaee737..1ce7d556b20e 100644 --- a/dom/media/mediasource/ContainerParser.cpp +++ b/dom/media/mediasource/ContainerParser.cpp @@ -116,7 +116,7 @@ class WebMContainerParser WebMBufferedParser parser(0); nsTArray mapping; - ReentrantMonitor dummy MOZ_ANNOTATED("dummy"); + ReentrantMonitor dummy("dummy"); bool result = parser.Append(aData.Elements(), aData.Length(), mapping, dummy); if (!result) { @@ -134,7 +134,7 @@ class WebMContainerParser WebMBufferedParser parser(0); nsTArray mapping; - ReentrantMonitor dummy MOZ_ANNOTATED("dummy"); + ReentrantMonitor dummy("dummy"); parser.AppendMediaSegmentOnly(); bool result = parser.Append(aData.Elements(), aData.Length(), mapping, dummy); @@ -182,7 +182,7 @@ class WebMContainerParser nsTArray mapping; mapping.AppendElements(mOverlappedMapping); mOverlappedMapping.Clear(); - ReentrantMonitor dummy MOZ_ANNOTATED("dummy"); + ReentrantMonitor dummy("dummy"); mParser.Append(aData.Elements(), aData.Length(), mapping, dummy); if (mResource) { mResource->AppendData(aData); diff --git a/dom/media/mediasource/MediaSourceDemuxer.h b/dom/media/mediasource/MediaSourceDemuxer.h index 332d7bb35d80..24decfe43953 100644 --- a/dom/media/mediasource/MediaSourceDemuxer.h +++ b/dom/media/mediasource/MediaSourceDemuxer.h @@ -83,7 +83,7 @@ class MediaSourceDemuxer : public MediaDataDemuxer, MozPromiseHolder mInitPromise; // Monitor to protect members below across multiple threads. - mutable Monitor mMonitor MOZ_UNANNOTATED; + mutable Monitor mMonitor; RefPtr mAudioTrack; RefPtr mVideoTrack; MediaInfo mInfo; @@ -138,7 +138,7 @@ class MediaSourceTrackDemuxer RefPtr mParent; TrackInfo::TrackType mType; // Monitor protecting members below accessed from multiple threads. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; media::TimeUnit mNextRandomAccessPoint; // Would be accessed in MFR's demuxer proxy task queue and TaskQueue, and // only be set on the TaskQueue. It can be accessed while on TaskQueue without diff --git a/dom/media/mediasource/TrackBuffersManager.h b/dom/media/mediasource/TrackBuffersManager.h index add157dac9ca..77bae4483bc1 100644 --- a/dom/media/mediasource/TrackBuffersManager.h +++ b/dom/media/mediasource/TrackBuffersManager.h @@ -514,7 +514,7 @@ class TrackBuffersManager final Atomic mEvictionState; // Monitor to protect following objects accessed across multiple threads. - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; // mTaskQueue is only ever written after construction on the task queue. // As such, it can be accessed while on task queue without the need for the // mutex. diff --git a/dom/media/ogg/OggCodecStore.h b/dom/media/ogg/OggCodecStore.h index bcde8bed0089..b3246ffe0c95 100644 --- a/dom/media/ogg/OggCodecStore.h +++ b/dom/media/ogg/OggCodecStore.h @@ -29,7 +29,7 @@ class OggCodecStore { nsClassHashtable mCodecStates; // Protects the |mCodecStates| and the |mKnownStreams| members. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; }; } // namespace mozilla diff --git a/dom/media/platforms/AllocationPolicy.h b/dom/media/platforms/AllocationPolicy.h index 18784ea28c7d..50a2040c4b7d 100644 --- a/dom/media/platforms/AllocationPolicy.h +++ b/dom/media/platforms/AllocationPolicy.h @@ -57,7 +57,7 @@ class GlobalAllocPolicy { private: // Protect access to Instance(). - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; }; /** This the actual base implementation underneath all AllocPolicy objects and @@ -86,7 +86,7 @@ class AllocPolicyImpl : public AllocPolicy { void ResolvePromise(ReentrantMonitorAutoEnter& aProofOfLock); const int mMaxDecoderLimit; - ReentrantMonitor mMonitor MOZ_UNANNOTATED; + ReentrantMonitor mMonitor; // The number of decoders available for creation. int mDecoderLimit; // Requests to acquire tokens. diff --git a/dom/media/platforms/PDMFactory.cpp b/dom/media/platforms/PDMFactory.cpp index ffb3be4c9f03..9b0342ce82c3 100644 --- a/dom/media/platforms/PDMFactory.cpp +++ b/dom/media/platforms/PDMFactory.cpp @@ -148,7 +148,7 @@ class PDMInitializer final { } static bool sHasInitializedPDMs; - static StaticMutex sMonitor MOZ_UNANNOTATED; + static StaticMutex sMonitor; }; bool PDMInitializer::sHasInitializedPDMs = false; diff --git a/dom/media/platforms/SimpleMap.h b/dom/media/platforms/SimpleMap.h index c26bff1e9afd..415e8542c9f3 100644 --- a/dom/media/platforms/SimpleMap.h +++ b/dom/media/platforms/SimpleMap.h @@ -46,7 +46,7 @@ class SimpleMap { } private: - Mutex mMutex MOZ_UNANNOTATED; // To protect mMap. + Mutex mMutex; // To protect mMap. AutoTArray mMap; }; diff --git a/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h b/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h index 06d72e3aae54..63a5944fe632 100644 --- a/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h +++ b/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h @@ -51,7 +51,7 @@ class SamplesWaitingForKey { ~SamplesWaitingForKey(); private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; RefPtr mProxy; struct SampleEntry { RefPtr mSample; diff --git a/dom/media/platforms/apple/AppleVTDecoder.h b/dom/media/platforms/apple/AppleVTDecoder.h index 167d28c6ff8a..84d99badcbdd 100644 --- a/dom/media/platforms/apple/AppleVTDecoder.h +++ b/dom/media/platforms/apple/AppleVTDecoder.h @@ -112,7 +112,7 @@ class AppleVTDecoder : public MediaDataDecoder, // not required and so input samples on mTaskQueue need not be processed. Atomic mIsFlushing; // Protects mReorderQueue and mPromise. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; ReorderQueue mReorderQueue; MozMonitoredPromiseHolder mPromise; diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h index 1b0806728588..d89842bc251f 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h @@ -65,9 +65,8 @@ class FFmpegDataDecoder AVCodecID mCodecID; // set in constructor protected: - static StaticMutex sMutex - MOZ_UNANNOTATED; // used to provide critical-section locking - // for calls into ffmpeg + static StaticMutex sMutex; // used to provide critical-section locking + // for calls into ffmpeg const RefPtr mTaskQueue; // set in constructor private: diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h index 47e248550809..c506d22430d4 100644 --- a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +++ b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h @@ -131,7 +131,7 @@ class VideoFramePool final { private: // Protect mDMABufSurfaces pool access - Mutex mSurfaceLock MOZ_UNANNOTATED; + Mutex mSurfaceLock; nsTArray> mDMABufSurfaces; // We may fail to create texture over DMABuf memory due to driver bugs so // check that before we export first DMABuf video frame. diff --git a/dom/media/platforms/wmf/DXVA2Manager.cpp b/dom/media/platforms/wmf/DXVA2Manager.cpp index 79e21b728534..a19e84db0015 100644 --- a/dom/media/platforms/wmf/DXVA2Manager.cpp +++ b/dom/media/platforms/wmf/DXVA2Manager.cpp @@ -941,7 +941,7 @@ D3D11DXVA2Manager::CopyToImage(IMFSample* aVideoSample, if (!mutex && mDevice != DeviceManagerDx::Get()->GetCompositorDevice() && mSyncObject) { - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; // Ensure that we only ever attempt to synchronise via the sync object // serially as when using the same D3D11 device for multiple video decoders // it can lead to deadlocks. diff --git a/dom/media/platforms/wmf/DXVA2Manager.h b/dom/media/platforms/wmf/DXVA2Manager.h index 5e088c5d92a3..7cb6209aa083 100644 --- a/dom/media/platforms/wmf/DXVA2Manager.h +++ b/dom/media/platforms/wmf/DXVA2Manager.h @@ -73,7 +73,7 @@ class DXVA2Manager { const nsAString& aDriverVersionString); protected: - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; DXVA2Manager(); bool IsUnsupportedResolution(const uint32_t& aWidth, const uint32_t& aHeight, diff --git a/dom/media/platforms/wmf/WMFDecoderModule.cpp b/dom/media/platforms/wmf/WMFDecoderModule.cpp index 19e3f5839835..f725c42cd8dd 100644 --- a/dom/media/platforms/wmf/WMFDecoderModule.cpp +++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp @@ -242,7 +242,7 @@ already_AddRefed WMFDecoderModule::CreateAudioDecoder( template static bool CanCreateWMFDecoder() { - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; StaticMutexAutoLock lock(sMutex); static Maybe result; if (result.isNothing()) { diff --git a/dom/media/systemservices/CamerasChild.h b/dom/media/systemservices/CamerasChild.h index 62d4c0c64fe9..d5218d29c50b 100644 --- a/dom/media/systemservices/CamerasChild.h +++ b/dom/media/systemservices/CamerasChild.h @@ -231,7 +231,7 @@ class CamerasChild final : public PCamerasChild { nsTArray mCallbacks; // Protects the callback arrays - Mutex mCallbackMutex MOZ_UNANNOTATED; + Mutex mCallbackMutex; bool mIPCIsAlive; @@ -243,11 +243,11 @@ class CamerasChild final : public PCamerasChild { // request. The Notify on receiving the response will then unblock // both waiters and one will be guaranteed to get the wrong result. // Take this one before taking mReplyMonitor. - Mutex mRequestMutex MOZ_UNANNOTATED; + Mutex mRequestMutex; // Hold to wait for an async response to our calls *and* until the // user of LockAndDispatch<> has read the data out. This is done by // keeping the LockAndDispatch object alive. - Monitor mReplyMonitor MOZ_UNANNOTATED; + Monitor mReplyMonitor; // Async response valid? bool mReceivedReply; // Async responses data contents; diff --git a/dom/media/systemservices/MediaSystemResourceManager.cpp b/dom/media/systemservices/MediaSystemResourceManager.cpp index 414ef8e81df1..49574be8eac5 100644 --- a/dom/media/systemservices/MediaSystemResourceManager.cpp +++ b/dom/media/systemservices/MediaSystemResourceManager.cpp @@ -59,7 +59,7 @@ void MediaSystemResourceManager::Init() { return; } - ReentrantMonitor barrier MOZ_UNANNOTATED("MediaSystemResourceManager::Init"); + ReentrantMonitor barrier("MediaSystemResourceManager::Init"); ReentrantMonitorAutoEnter mainThreadAutoMon(barrier); bool done = false; @@ -191,8 +191,7 @@ bool MediaSystemResourceManager::AcquireSyncNoWait( MOZ_ASSERT(aClient); MOZ_ASSERT(!InImageBridgeChildThread()); - ReentrantMonitor barrier MOZ_UNANNOTATED( - "MediaSystemResourceManager::AcquireSyncNoWait"); + ReentrantMonitor barrier("MediaSystemResourceManager::AcquireSyncNoWait"); ReentrantMonitorAutoEnter autoMon(barrier); bool done = false; { diff --git a/dom/media/systemservices/MediaSystemResourceManager.h b/dom/media/systemservices/MediaSystemResourceManager.h index 293595ece0f9..98dd1e8f4bf5 100644 --- a/dom/media/systemservices/MediaSystemResourceManager.h +++ b/dom/media/systemservices/MediaSystemResourceManager.h @@ -65,7 +65,7 @@ class MediaSystemResourceManager { void HandleAcquireResult(uint32_t aId, bool aSuccess); - ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + ReentrantMonitor mReentrantMonitor; bool mShutDown; diff --git a/dom/media/systemservices/MediaUtils.h b/dom/media/systemservices/MediaUtils.h index 7af2ccaef042..18f1104b9b88 100644 --- a/dom/media/systemservices/MediaUtils.h +++ b/dom/media/systemservices/MediaUtils.h @@ -225,7 +225,7 @@ void Await(already_AddRefed aPool, RejectFunction&& aRejectFunction) { RefPtr taskQueue = new TaskQueue(std::move(aPool), "MozPromiseAwait"); - Monitor mon MOZ_UNANNOTATED(__func__); + Monitor mon(__func__); bool done = false; aPromise->Then( @@ -256,7 +256,7 @@ Await(already_AddRefed aPool, RefPtr> aPromise) { RefPtr taskQueue = new TaskQueue(std::move(aPool), "MozPromiseAwait"); - Monitor mon MOZ_UNANNOTATED(__func__); + Monitor mon(__func__); bool done = false; typename MozPromiseResolve(true, __func__); mResolved = true; } - Mutex mLock MOZ_UNANNOTATED; // protects mBlockers and mResolved. + Mutex mLock; // protects mBlockers and mResolved. std::map mBlockers; bool mResolved = false; const RefPtr mPromise; diff --git a/dom/media/systemservices/OSXRunLoopSingleton.cpp b/dom/media/systemservices/OSXRunLoopSingleton.cpp index 6dea084e279b..06199bcbc828 100644 --- a/dom/media/systemservices/OSXRunLoopSingleton.cpp +++ b/dom/media/systemservices/OSXRunLoopSingleton.cpp @@ -12,7 +12,7 @@ #include static bool gRunLoopSet = false; -static mozilla::StaticMutex gMutex MOZ_UNANNOTATED; +static mozilla::StaticMutex gMutex; void mozilla_set_coreaudio_notification_runloop_if_needed() { mozilla::StaticMutexAutoLock lock(gMutex); diff --git a/dom/media/systemservices/OpenSLESProvider.h b/dom/media/systemservices/OpenSLESProvider.h index 525ee79abc83..f1f5a7e4defe 100644 --- a/dom/media/systemservices/OpenSLESProvider.h +++ b/dom/media/systemservices/OpenSLESProvider.h @@ -50,7 +50,7 @@ class OpenSLESProvider { void DestroyEngine(SLObjectItf* aObjectm); // Protect all our internal variables - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; SLObjectItf mSLEngine; int mSLEngineUsers; bool mIsRealized; diff --git a/dom/media/systemservices/ShmemPool.h b/dom/media/systemservices/ShmemPool.h index 4a08f0892b63..f4ae91246232 100644 --- a/dom/media/systemservices/ShmemPool.h +++ b/dom/media/systemservices/ShmemPool.h @@ -169,7 +169,7 @@ class ShmemPool final { &aRes.mShmem)); } const PoolType mPoolType; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; size_t mPoolFree; bool mErrorLogged; #ifdef DEBUG diff --git a/dom/media/systemservices/video_engine/tab_capturer.h b/dom/media/systemservices/video_engine/tab_capturer.h index e3081c3f49c9..4d82d8927d2c 100644 --- a/dom/media/systemservices/video_engine/tab_capturer.h +++ b/dom/media/systemservices/video_engine/tab_capturer.h @@ -61,7 +61,7 @@ class TabCapturer { // Used to protect mCallback, since TabCapturer's lifetime might be // longer than mCallback's on stop/shutdown, and we may be waiting on a // tab to finish capturing on MainThread. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; webrtc::DesktopCapturer::Callback* mCallback = nullptr; uint64_t mBrowserId = 0; diff --git a/dom/media/webaudio/AudioBuffer.cpp b/dom/media/webaudio/AudioBuffer.cpp index c4a745e54973..d8371c96d4c0 100644 --- a/dom/media/webaudio/AudioBuffer.cpp +++ b/dom/media/webaudio/AudioBuffer.cpp @@ -72,7 +72,7 @@ class AudioBufferMemoryTracker : public nsIMemoryReporter { void Init(); /* This protects all members of this class. */ - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; static StaticRefPtr sSingleton; nsTHashSet mBuffers; }; diff --git a/dom/media/webaudio/ScriptProcessorNode.cpp b/dom/media/webaudio/ScriptProcessorNode.cpp index 43d02e09a017..0abadc204e2b 100644 --- a/dom/media/webaudio/ScriptProcessorNode.cpp +++ b/dom/media/webaudio/ScriptProcessorNode.cpp @@ -80,7 +80,7 @@ class SharedBuffers final { // Synchronizes access to mBufferList. Note that it's the responsibility // of the callers to perform the required locking, and we assert that every // time we access mBufferList. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // The list representing the queue. BufferList mBufferList; }; diff --git a/dom/media/webaudio/blink/HRTFDatabaseLoader.h b/dom/media/webaudio/blink/HRTFDatabaseLoader.h index 060d9e7a6c9b..05668b4e73aa 100644 --- a/dom/media/webaudio/blink/HRTFDatabaseLoader.h +++ b/dom/media/webaudio/blink/HRTFDatabaseLoader.h @@ -143,7 +143,7 @@ class HRTFDatabaseLoader { nsAutoRef m_hrtfDatabase; // Holding a m_threadLock is required when accessing m_databaseLoaderThread. - mozilla::Mutex m_threadLock MOZ_UNANNOTATED; + mozilla::Mutex m_threadLock; PRThread* m_databaseLoaderThread; float m_databaseSampleRate; diff --git a/dom/media/webaudio/blink/ReverbConvolver.h b/dom/media/webaudio/blink/ReverbConvolver.h index 8000ba811e7f..09e61d69df32 100644 --- a/dom/media/webaudio/blink/ReverbConvolver.h +++ b/dom/media/webaudio/blink/ReverbConvolver.h @@ -83,7 +83,7 @@ class ReverbConvolver { // Background thread and synchronization base::Thread m_backgroundThread; - mozilla::Monitor m_backgroundThreadMonitor MOZ_UNANNOTATED; + mozilla::Monitor m_backgroundThreadMonitor; bool m_useBackgroundThreads; std::atomic m_wantsToExit; std::atomic m_moreInputBuffered; diff --git a/dom/media/webm/WebMBufferedParser.h b/dom/media/webm/WebMBufferedParser.h index 3dd4767f9f15..80f08fd80321 100644 --- a/dom/media/webm/WebMBufferedParser.h +++ b/dom/media/webm/WebMBufferedParser.h @@ -298,7 +298,7 @@ class WebMBufferedState final { MOZ_COUNTED_DTOR(WebMBufferedState) // Synchronizes access to the mTimeMapping array and mLastBlockOffset. - ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + ReentrantMonitor mReentrantMonitor; // Sorted (by offset) map of data offsets to timecodes. Populated // on the main thread as data is received and parsed by WebMBufferedParsers. diff --git a/dom/media/webrtc/CubebDeviceEnumerator.cpp b/dom/media/webrtc/CubebDeviceEnumerator.cpp index b5e705ea7d36..ce0badf66b7d 100644 --- a/dom/media/webrtc/CubebDeviceEnumerator.cpp +++ b/dom/media/webrtc/CubebDeviceEnumerator.cpp @@ -23,7 +23,7 @@ using AudioDeviceSet = CubebDeviceEnumerator::AudioDeviceSet; /* static */ static StaticRefPtr sInstance; -static StaticMutex sInstanceMutex MOZ_UNANNOTATED; +static StaticMutex sInstanceMutex; /* static */ CubebDeviceEnumerator* CubebDeviceEnumerator::GetInstance() { diff --git a/dom/media/webrtc/CubebDeviceEnumerator.h b/dom/media/webrtc/CubebDeviceEnumerator.h index 2dee70ad63d4..18aef5a974bf 100644 --- a/dom/media/webrtc/CubebDeviceEnumerator.h +++ b/dom/media/webrtc/CubebDeviceEnumerator.h @@ -69,7 +69,7 @@ class CubebDeviceEnumerator final { void AudioDeviceListChanged(Side aSide); RefPtr EnumerateAudioDevices(Side aSide); // Synchronize access to mInputDevices and mOutputDevices; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; RefPtr mInputDevices; RefPtr mOutputDevices; // If mManual*Invalidation is true, then it is necessary to query the device diff --git a/dom/media/webrtc/MediaEngineRemoteVideoSource.h b/dom/media/webrtc/MediaEngineRemoteVideoSource.h index cecf88288c38..9d1568262779 100644 --- a/dom/media/webrtc/MediaEngineRemoteVideoSource.h +++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.h @@ -152,7 +152,7 @@ class MediaEngineRemoteVideoSource : public MediaEngineSource, // mMutex protects certain members on 3 threads: // MediaManager, Cameras IPC and MediaTrackGraph. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Current state of this source. // Set under mMutex on the owning thread. Accessed under one of the two. diff --git a/dom/media/webrtc/libwebrtcglue/AudioConduit.h b/dom/media/webrtc/libwebrtcglue/AudioConduit.h index 328484da16b8..c503cff854df 100644 --- a/dom/media/webrtc/libwebrtcglue/AudioConduit.h +++ b/dom/media/webrtc/libwebrtcglue/AudioConduit.h @@ -246,7 +246,7 @@ class WebrtcAudioConduit : public AudioSessionConduit, // Accessed only on the Call thread. bool mDtmfEnabled; - mutable RWLock mLock MOZ_UNANNOTATED; + mutable RWLock mLock; // Call worker thread. All access to mCall->Call() happens here. const RefPtr mCallThread; diff --git a/dom/media/webrtc/libwebrtcglue/VideoConduit.h b/dom/media/webrtc/libwebrtcglue/VideoConduit.h index 4a15e14bf3e3..20df082fbb7a 100644 --- a/dom/media/webrtc/libwebrtcglue/VideoConduit.h +++ b/dom/media/webrtc/libwebrtcglue/VideoConduit.h @@ -271,7 +271,7 @@ class WebrtcVideoConduit bool RequiresNewSendStream(const VideoCodecConfig& newConfig) const; - mutable mozilla::ReentrantMonitor mRendererMonitor MOZ_UNANNOTATED; + mutable mozilla::ReentrantMonitor mRendererMonitor; // Accessed on any thread under mRendererMonitor. RefPtr mRenderer; @@ -328,7 +328,7 @@ class WebrtcVideoConduit // that will update the webrtc.org configuration. WatchManager mWatchManager; - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; // Decoder factory used by mRecvStream when it needs new decoders. This is // not shared broader like some state in the WebrtcCallWrapper because it diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h index bbcd6773af52..6993f8a9eed6 100644 --- a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h +++ b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h @@ -279,7 +279,7 @@ class WebrtcGmpVideoEncoder : public GMPVideoEncoderCallbackProxy, uint32_t mMaxPayloadSize; webrtc::CodecSpecificInfo mCodecSpecificInfo; // Protects mCallback - Mutex mCallbackMutex MOZ_UNANNOTATED; + Mutex mCallbackMutex; webrtc::EncodedImageCallback* mCallback; Maybe mCachedPluginId; const std::string mPCHandle; @@ -430,7 +430,7 @@ class WebrtcGmpVideoDecoder : public GMPVideoDecoderCallbackProxy { nsTArray> mQueuedFrames; GMPVideoHost* mHost; // Protects mCallback - Mutex mCallbackMutex MOZ_UNANNOTATED; + Mutex mCallbackMutex; webrtc::DecodedImageCallback* mCallback; Maybe mCachedPluginId; Atomic mDecoderStatus; diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcMediaDataEncoderCodec.h b/dom/media/webrtc/libwebrtcglue/WebrtcMediaDataEncoderCodec.h index dcda01c5cede..1e86f5dd227d 100644 --- a/dom/media/webrtc/libwebrtcglue/WebrtcMediaDataEncoderCodec.h +++ b/dom/media/webrtc/libwebrtcglue/WebrtcMediaDataEncoderCodec.h @@ -57,7 +57,7 @@ class WebrtcMediaDataEncoder : public RefCountedWebrtcVideoEncoder { const RefPtr mFactory; RefPtr mEncoder; - Mutex mCallbackMutex MOZ_UNANNOTATED; // Protects mCallback and mError. + Mutex mCallbackMutex; // Protects mCallback and mError. webrtc::EncodedImageCallback* mCallback = nullptr; MediaResult mError = NS_OK; diff --git a/dom/media/webrtc/transport/nr_socket_prsock.h b/dom/media/webrtc/transport/nr_socket_prsock.h index 010fcb59bc20..8616e796827d 100644 --- a/dom/media/webrtc/transport/nr_socket_prsock.h +++ b/dom/media/webrtc/transport/nr_socket_prsock.h @@ -283,7 +283,7 @@ class NrUdpSocketIpc : public NrSocketIpc { // STS thread executor void recv_callback_s(RefPtr msg); - ReentrantMonitor monitor_ MOZ_UNANNOTATED; // protects err_and state_ + ReentrantMonitor monitor_; // protects err_and state_ bool err_; NrSocketIpcState state_; diff --git a/dom/media/webrtc/transportbridge/MediaPipeline.cpp b/dom/media/webrtc/transportbridge/MediaPipeline.cpp index 73b23523a7fe..c0afec49e861 100644 --- a/dom/media/webrtc/transportbridge/MediaPipeline.cpp +++ b/dom/media/webrtc/transportbridge/MediaPipeline.cpp @@ -1546,7 +1546,7 @@ class MediaPipelineReceiveVideo::PipelineListener private: RefPtr mImageContainer; - Mutex mMutex MOZ_UNANNOTATED; // Protects the below members. + Mutex mMutex; // Protects the below members. PrincipalHandle mPrincipalHandle; // Set to true on the sts thread if privacy is requested when ALPN was // negotiated. Set to false again when mPrincipalHandle is private. diff --git a/dom/midi/MIDIMessageQueue.h b/dom/midi/MIDIMessageQueue.h index cadfc1b2495e..10a1127275c5 100644 --- a/dom/midi/MIDIMessageQueue.h +++ b/dom/midi/MIDIMessageQueue.h @@ -49,7 +49,7 @@ class MIDIMessageQueue { // Array of messages to be sent. nsTArray mMessageQueue; // Mutex for coordinating cross thread array access. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; } // namespace dom diff --git a/dom/midi/MIDIPlatformService.h b/dom/midi/MIDIPlatformService.h index ad55757581d6..7dfa3ec1dc79 100644 --- a/dom/midi/MIDIPlatformService.h +++ b/dom/midi/MIDIPlatformService.h @@ -149,7 +149,7 @@ class MIDIPlatformService { nsClassHashtable mMessageQueues; // Mutex for managing access to message queue objects. - Mutex mMessageQueueMutex MOZ_UNANNOTATED; + Mutex mMessageQueueMutex; }; } // namespace mozilla::dom diff --git a/dom/midi/midirMIDIPlatformService.h b/dom/midi/midirMIDIPlatformService.h index ac13c06b6a41..0a918b91cdd5 100644 --- a/dom/midi/midirMIDIPlatformService.h +++ b/dom/midi/midirMIDIPlatformService.h @@ -47,7 +47,7 @@ class midirMIDIPlatformService : public MIDIPlatformService { // midir has its own internal threads and we can't execute jobs directly on // them, instead we forward them to the background thread the service was // created in. - static StaticMutex gBackgroundThreadMutex MOZ_UNANNOTATED; + static StaticMutex gBackgroundThreadMutex; static nsCOMPtr gBackgroundThread; }; diff --git a/dom/performance/PerformanceService.cpp b/dom/performance/PerformanceService.cpp index 746d278b77ae..43eed2ed4eec 100644 --- a/dom/performance/PerformanceService.cpp +++ b/dom/performance/PerformanceService.cpp @@ -14,7 +14,7 @@ namespace mozilla::dom { static StaticRefPtr gPerformanceService; -static StaticMutex gPerformanceServiceMutex MOZ_UNANNOTATED; +static StaticMutex gPerformanceServiceMutex; /* static */ PerformanceService* PerformanceService::GetOrCreate() { diff --git a/dom/performance/PerformanceStorageWorker.h b/dom/performance/PerformanceStorageWorker.h index aedc36e599eb..6e7f6e37d8f7 100644 --- a/dom/performance/PerformanceStorageWorker.h +++ b/dom/performance/PerformanceStorageWorker.h @@ -37,7 +37,7 @@ class PerformanceStorageWorker final : public PerformanceStorage { PerformanceStorageWorker(); ~PerformanceStorageWorker(); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Protected by mutex. // Created and released on worker-thread. Used also on main-thread. diff --git a/dom/promise/PromiseWorkerProxy.h b/dom/promise/PromiseWorkerProxy.h index 75098dd1ab27..0e93bbc9e021 100644 --- a/dom/promise/PromiseWorkerProxy.h +++ b/dom/promise/PromiseWorkerProxy.h @@ -207,7 +207,7 @@ class PromiseWorkerProxy : public PromiseNativeHandler, const PromiseWorkerProxyStructuredCloneCallbacks* mCallbacks; // Ensure the worker and the main thread won't race to access |mCleanedUp|. - Mutex mCleanUpLock MOZ_UNANNOTATED; + Mutex mCleanUpLock; }; } // namespace dom } // namespace mozilla diff --git a/dom/quota/QuotaManager.h b/dom/quota/QuotaManager.h index c3cbd2eb758a..d23b2be08e47 100644 --- a/dom/quota/QuotaManager.h +++ b/dom/quota/QuotaManager.h @@ -597,7 +597,7 @@ class QuotaManager final : public BackgroundThreadObject { // Accesses to mQuotaManagerShutdownSteps must be protected by mQuotaMutex. nsCString mQuotaManagerShutdownSteps; - mutable mozilla::Mutex mQuotaMutex MOZ_UNANNOTATED; + mutable mozilla::Mutex mQuotaMutex; nsClassHashtable mGroupInfoPairs; diff --git a/dom/serviceworkers/ServiceWorkerRegistrar.h b/dom/serviceworkers/ServiceWorkerRegistrar.h index b8eeab53954b..9fdd246d0764 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrar.h +++ b/dom/serviceworkers/ServiceWorkerRegistrar.h @@ -97,7 +97,7 @@ class ServiceWorkerRegistrar : public nsIObserver, bool IsSupportedVersion(const nsACString& aVersion) const; protected: - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; // protected by mMonitor. nsCOMPtr mProfileDir; diff --git a/dom/storage/LocalStorageCache.h b/dom/storage/LocalStorageCache.h index 2c786c8a5901..4c9f9a480dd4 100644 --- a/dom/storage/LocalStorageCache.h +++ b/dom/storage/LocalStorageCache.h @@ -244,7 +244,7 @@ class LocalStorageCache : public LocalStorageCacheBridge { Data mData[kDataSetCount]; // This monitor is used to wait for full load of data. - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; // Flag that is initially false. When the cache is about to work with // the database (i.e. it is persistent) this flags is set to true after diff --git a/dom/storage/StorageDBThread.cpp b/dom/storage/StorageDBThread.cpp index 2bbfd9016328..846e5bf2ef17 100644 --- a/dom/storage/StorageDBThread.cpp +++ b/dom/storage/StorageDBThread.cpp @@ -71,7 +71,7 @@ StorageDBBridge::StorageDBBridge() class StorageDBThread::InitHelper final : public Runnable { nsCOMPtr mOwningThread; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; mozilla::CondVar mCondVar; nsString mProfilePath; nsresult mMainThreadResultCode; diff --git a/dom/storage/StorageDBThread.h b/dom/storage/StorageDBThread.h index d3b131fea097..068a65df31d5 100644 --- a/dom/storage/StorageDBThread.h +++ b/dom/storage/StorageDBThread.h @@ -286,7 +286,7 @@ class StorageDBThread final { virtual ~ThreadObserver() = default; bool mHasPendingEvents; // The monitor we drive the thread with - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; }; class InitHelper; diff --git a/dom/storage/StorageIPC.cpp b/dom/storage/StorageIPC.cpp index 82ceae30f99c..3f1bfcb81a53 100644 --- a/dom/storage/StorageIPC.cpp +++ b/dom/storage/StorageIPC.cpp @@ -849,7 +849,7 @@ class SyncLoadCacheHelper : public LocalStorageCacheBridge { } private: - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; nsCString mSuffix, mOrigin; nsTArray* mKeys; nsTArray* mValues; diff --git a/dom/webauthn/U2FHIDTokenManager.cpp b/dom/webauthn/U2FHIDTokenManager.cpp index df5c5ceb2606..3b37347c5332 100644 --- a/dom/webauthn/U2FHIDTokenManager.cpp +++ b/dom/webauthn/U2FHIDTokenManager.cpp @@ -13,7 +13,7 @@ namespace mozilla { namespace dom { -static StaticMutex gInstanceMutex MOZ_UNANNOTATED; +static StaticMutex gInstanceMutex; static U2FHIDTokenManager* gInstance; static nsIThread* gPBackgroundThread; diff --git a/dom/webauthn/U2FTokenManager.cpp b/dom/webauthn/U2FTokenManager.cpp index 9a334ff590cb..8adf1709a760 100644 --- a/dom/webauthn/U2FTokenManager.cpp +++ b/dom/webauthn/U2FTokenManager.cpp @@ -141,7 +141,7 @@ class U2FPrefManager final : public nsIObserver { Preferences::GetBool(PREF_WEBAUTHN_ALLOW_DIRECT_ATTESTATION); } - Mutex mPrefMutex MOZ_UNANNOTATED; + Mutex mPrefMutex; bool mSoftTokenEnabled; int mSoftTokenCounter; bool mUsbTokenEnabled; diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.cpp b/dom/webbrowserpersist/nsWebBrowserPersist.cpp index 2a855788d509..991a2117329c 100644 --- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp +++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp @@ -121,7 +121,7 @@ struct nsWebBrowserPersist::OutputData { nsCOMPtr mFile; nsCOMPtr mOriginalLocation; nsCOMPtr mStream; - Mutex mStreamMutex MOZ_UNANNOTATED; + Mutex mStreamMutex; int64_t mSelfProgress; int64_t mSelfProgressMax; bool mCalcFileExt; diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.h b/dom/webbrowserpersist/nsWebBrowserPersist.h index 47f13b1cb472..a34370713f7a 100644 --- a/dom/webbrowserpersist/nsWebBrowserPersist.h +++ b/dom/webbrowserpersist/nsWebBrowserPersist.h @@ -155,7 +155,7 @@ class nsWebBrowserPersist final : public nsIInterfaceRequestor, */ nsCOMPtr mProgressListener2; nsCOMPtr mEventSink; - mozilla::Mutex mOutputMapMutex MOZ_UNANNOTATED; + mozilla::Mutex mOutputMapMutex; nsClassHashtable mOutputMap; nsClassHashtable mUploadList; nsCOMPtr mBackgroundQueue; diff --git a/dom/webgpu/ipc/WebGPUParent.cpp b/dom/webgpu/ipc/WebGPUParent.cpp index d23f84132f28..9279b2c69727 100644 --- a/dom/webgpu/ipc/WebGPUParent.cpp +++ b/dom/webgpu/ipc/WebGPUParent.cpp @@ -63,7 +63,7 @@ class PresentationData { std::vector mUnassignedBufferIds; std::vector mAvailableBufferIds; std::vector mQueuedBufferIds; - Mutex mBuffersLock MOZ_UNANNOTATED; + Mutex mBuffersLock; PresentationData(RawId aDeviceId, RawId aQueueId, already_AddRefed aImageHost, diff --git a/dom/websocket/WebSocket.cpp b/dom/websocket/WebSocket.cpp index 4486f37c830a..ccd42676e126 100644 --- a/dom/websocket/WebSocket.cpp +++ b/dom/websocket/WebSocket.cpp @@ -248,7 +248,7 @@ class WebSocketImpl final : public nsIInterfaceRequestor, bool mIsMainThread; // This mutex protects mWorkerShuttingDown. - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; bool mWorkerShuttingDown; RefPtr mService; diff --git a/dom/websocket/WebSocket.h b/dom/websocket/WebSocket.h index d94fd64f9ebe..e73c5fd705df 100644 --- a/dom/websocket/WebSocket.h +++ b/dom/websocket/WebSocket.h @@ -178,7 +178,7 @@ class WebSocket final : public DOMEventTargetHelper { // This mutex protects mReadyState that is the only variable that is used in // different threads. - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; // This value should not be used directly but use ReadyState() instead. uint16_t mReadyState; diff --git a/dom/workers/Queue.h b/dom/workers/Queue.h index 646ea2c43b94..7b4d80143238 100644 --- a/dom/workers/Queue.h +++ b/dom/workers/Queue.h @@ -54,7 +54,7 @@ struct StorageWithTArray { }; class LockingWithMutex { - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; protected: LockingWithMutex() : mMutex("LockingWithMutex::mMutex") {} diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 28e946af6ba4..2f62e220e616 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -1586,7 +1586,7 @@ class CrashIfHangingRunnable : public WorkerControlRunnable { void PostDispatch(WorkerPrivate* aWorkerPrivate, bool aDispatchResult) override {} - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; nsCString mMsg; FlippedOnce mHasMsg; }; diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h index 71b18316f30a..0ca5f99fab6f 100644 --- a/dom/workers/RuntimeService.h +++ b/dom/workers/RuntimeService.h @@ -60,7 +60,7 @@ class RuntimeService final : public nsIObserver { mozilla::TimeStamp mExpirationTime; }; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; // Protected by mMutex. nsClassHashtable mDomainMap; diff --git a/dom/workers/WorkerCSPEventListener.h b/dom/workers/WorkerCSPEventListener.h index f3491316aaae..007cca41aff9 100644 --- a/dom/workers/WorkerCSPEventListener.h +++ b/dom/workers/WorkerCSPEventListener.h @@ -30,7 +30,7 @@ class WorkerCSPEventListener final : public nsICSPEventListener { WorkerCSPEventListener(); ~WorkerCSPEventListener() = default; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Protected by mutex. RefPtr mWorkerRef; diff --git a/dom/workers/WorkerDebuggerManager.h b/dom/workers/WorkerDebuggerManager.h index 1b09a230d19f..53fe35f1cb5c 100644 --- a/dom/workers/WorkerDebuggerManager.h +++ b/dom/workers/WorkerDebuggerManager.h @@ -34,7 +34,7 @@ class WorkerPrivate; class WorkerDebuggerManager final : public nsIObserver, public nsIWorkerDebuggerManager { - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Protected by mMutex. nsTArray> mListeners; diff --git a/dom/workers/WorkerDocumentListener.h b/dom/workers/WorkerDocumentListener.h index 4bb46cadf2ab..edb9a78ee62b 100644 --- a/dom/workers/WorkerDocumentListener.h +++ b/dom/workers/WorkerDocumentListener.h @@ -31,7 +31,7 @@ class WorkerDocumentListener final { private: ~WorkerDocumentListener(); - Mutex mMutex MOZ_UNANNOTATED; // protects mWorkerRef + Mutex mMutex; // protects mWorkerRef RefPtr mWorkerRef; }; diff --git a/dom/workers/WorkerEventTarget.h b/dom/workers/WorkerEventTarget.h index f3a72aff7d60..7260fb8b0ca3 100644 --- a/dom/workers/WorkerEventTarget.h +++ b/dom/workers/WorkerEventTarget.h @@ -28,7 +28,7 @@ class WorkerEventTarget final : public nsISerialEventTarget { enum class Behavior : uint8_t { Hybrid, ControlOnly }; private: - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; CheckedUnsafePtr mWorkerPrivate; const Behavior mBehavior; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index eff33ba065eb..adac5597d155 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -935,7 +935,7 @@ nsString ComputeWorkerPrivateId() { class WorkerPrivate::EventTarget final : public nsISerialEventTarget { // This mutex protects mWorkerPrivate and must be acquired *before* the // WorkerPrivate's mutex whenever they must both be held. - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; WorkerPrivate* mWorkerPrivate; nsIEventTarget* mWeakNestedEventTarget; nsCOMPtr mNestedEventTarget; diff --git a/dom/workers/WorkerThread.h b/dom/workers/WorkerThread.h index a0bbf2369ad8..1ab6be3b7e72 100644 --- a/dom/workers/WorkerThread.h +++ b/dom/workers/WorkerThread.h @@ -48,7 +48,7 @@ class WorkerThreadFriendKey { class WorkerThread final : public nsThread { class Observer; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; CondVar mWorkerPrivateCondVar; // Protected by nsThread::mLock. diff --git a/dom/xhr/XMLHttpRequestMainThread.h b/dom/xhr/XMLHttpRequestMainThread.h index b61464389306..ec8852d7b2ef 100644 --- a/dom/xhr/XMLHttpRequestMainThread.h +++ b/dom/xhr/XMLHttpRequestMainThread.h @@ -121,7 +121,7 @@ class ArrayBufferBuilder { static bool AreOverlappingRegions(const uint8_t* aStart1, uint32_t aLength1, const uint8_t* aStart2, uint32_t aLength2); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // All of these are protected by mMutex. uint8_t* mDataPtr; diff --git a/dom/xhr/XMLHttpRequestString.cpp b/dom/xhr/XMLHttpRequestString.cpp index 01416c08aec5..f3d953971bb0 100644 --- a/dom/xhr/XMLHttpRequestString.cpp +++ b/dom/xhr/XMLHttpRequestString.cpp @@ -82,7 +82,7 @@ class XMLHttpRequestStringBuffer final { nsString& UnsafeData() { return mData; } - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // The following member variable is protected by mutex. nsString mData; diff --git a/extensions/permissions/PermissionManager.h b/extensions/permissions/PermissionManager.h index c659cba26854..114603450a39 100644 --- a/extensions/permissions/PermissionManager.h +++ b/extensions/permissions/PermissionManager.h @@ -365,7 +365,7 @@ class PermissionManager final : public nsIPermissionManager, private: ~PermissionManager(); - static StaticMutex sCreationMutex MOZ_UNANNOTATED; + static StaticMutex sCreationMutex; /** * Get all permissions for a given principal, which should not be isolated @@ -534,7 +534,7 @@ class PermissionManager final : public nsIPermissionManager, // This monitor is used to ensure the database reading before any other // operation. The reading of the database happens OMT. See |State| to know the // steps of the database reading. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; enum State { // Initial state. The database has not been read yet. diff --git a/extensions/spellcheck/src/mozPersonalDictionary.h b/extensions/spellcheck/src/mozPersonalDictionary.h index 584c7edf56af..78d680cec0ff 100644 --- a/extensions/spellcheck/src/mozPersonalDictionary.h +++ b/extensions/spellcheck/src/mozPersonalDictionary.h @@ -51,8 +51,8 @@ class mozPersonalDictionary final : public mozIPersonalDictionary, bool mSavePending; nsCOMPtr mFile; - mozilla::Monitor mMonitor MOZ_UNANNOTATED; - mozilla::Monitor mMonitorSave MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; + mozilla::Monitor mMonitorSave; nsTHashSet mDictionaryTable; nsTHashSet mIgnoreTable; diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index 9d42f636dda1..37ce1a3e1738 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -998,7 +998,7 @@ class SharedFTFace : public external::AtomicRefCounted { private: FT_Face mFace; SharedFTFaceData* mData; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; // Remember the last owner of the lock, even after unlocking, to allow users // to avoid reinitializing state on the FT face if the last owner hasn't // changed by the next time it is locked with the same owner. @@ -2013,7 +2013,7 @@ class GFX2D_API Factory { private: static FT_Library mFTLibrary; - static StaticMutex mFTLock MOZ_UNANNOTATED; + static StaticMutex mFTLock; public: #endif @@ -2082,10 +2082,10 @@ class GFX2D_API Factory { protected: // This guards access to the singleton devices above, as well as the // singleton devices in DrawTargetD2D1. - static StaticMutex mDeviceLock MOZ_UNANNOTATED; + static StaticMutex mDeviceLock; // This synchronizes access between different D2D drawtargets and their // implied dependency graph. - static StaticMutex mDTDependencyLock MOZ_UNANNOTATED; + static StaticMutex mDTDependencyLock; friend class DrawTargetD2D1; #endif // WIN32 diff --git a/gfx/2d/DrawTargetSkia.h b/gfx/2d/DrawTargetSkia.h index 7ac9741ffee1..571871c66d02 100644 --- a/gfx/2d/DrawTargetSkia.h +++ b/gfx/2d/DrawTargetSkia.h @@ -191,7 +191,7 @@ class DrawTargetSkia : public DrawTarget { SkCanvas* mCanvas = nullptr; RefPtr mBackingSurface; RefPtr mSnapshot; - Mutex mSnapshotLock MOZ_UNANNOTATED; + Mutex mSnapshotLock; #ifdef MOZ_WIDGET_COCOA friend class BorrowedCGContext; diff --git a/gfx/2d/NativeFontResourceDWrite.cpp b/gfx/2d/NativeFontResourceDWrite.cpp index e0b599fa767d..fa646e91b332 100644 --- a/gfx/2d/NativeFontResourceDWrite.cpp +++ b/gfx/2d/NativeFontResourceDWrite.cpp @@ -17,7 +17,7 @@ namespace mozilla { namespace gfx { -static StaticMutex sFontFileStreamsMutex MOZ_UNANNOTATED; +static StaticMutex sFontFileStreamsMutex; static uint64_t sNextFontFileKey = 0; static std::unordered_map sFontFileStreams; diff --git a/gfx/2d/SourceSurfaceSkia.h b/gfx/2d/SourceSurfaceSkia.h index 5f3d15454669..ce411dac6a98 100644 --- a/gfx/2d/SourceSurfaceSkia.h +++ b/gfx/2d/SourceSurfaceSkia.h @@ -67,7 +67,7 @@ class SourceSurfaceSkia : public DataSourceSurface { IntSize mSize; int32_t mStride; Atomic mDrawTarget; - Mutex mChangeMutex MOZ_UNANNOTATED; + Mutex mChangeMutex; bool mIsMapped; }; diff --git a/gfx/gl/AndroidSurfaceTexture.cpp b/gfx/gl/AndroidSurfaceTexture.cpp index c461082442d3..9ccbd71360b5 100644 --- a/gfx/gl/AndroidSurfaceTexture.cpp +++ b/gfx/gl/AndroidSurfaceTexture.cpp @@ -117,7 +117,7 @@ class AndroidSharedBlitGL final { return egl.fMakeCurrent(EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; static StaticRefPtr sContext; static size_t sInstanceCount; diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index 51c216b0012e..5243dab4b7f7 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -1211,7 +1211,7 @@ GLContext* GLContextProviderEGL::GetGlobalContext() { return nullptr; } // - -static StaticMutex sMutex MOZ_UNANNOTATED; +static StaticMutex sMutex; static StaticRefPtr gDefaultEglLibrary; RefPtr DefaultEglLibrary(nsACString* const out_failureId) { diff --git a/gfx/gl/SharedSurface.h b/gfx/gl/SharedSurface.h index 060db717c01d..5d3ac6462a54 100644 --- a/gfx/gl/SharedSurface.h +++ b/gfx/gl/SharedSurface.h @@ -150,7 +150,7 @@ class SurfaceFactory { const PartialSharedSurfaceDesc mDesc; protected: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; public: static UniquePtr Create(GLContext*, layers::TextureType); diff --git a/gfx/gl/SharedSurfaceEGL.h b/gfx/gl/SharedSurfaceEGL.h index 569421f945a1..2083f8f82584 100644 --- a/gfx/gl/SharedSurfaceEGL.h +++ b/gfx/gl/SharedSurfaceEGL.h @@ -25,7 +25,7 @@ class GLLibraryEGL; // EGLImage class SharedSurface_EGLImage final : public SharedSurface { - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; EGLSync mSync = 0; public: diff --git a/gfx/layers/AndroidHardwareBuffer.h b/gfx/layers/AndroidHardwareBuffer.h index 2328170c391a..00dda502e159 100644 --- a/gfx/layers/AndroidHardwareBuffer.h +++ b/gfx/layers/AndroidHardwareBuffer.h @@ -223,7 +223,7 @@ class AndroidHardwareBufferManager { Monitor& GetMonitor() { return mMonitor; } private: - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; std::unordered_map> mBuffers; diff --git a/gfx/layers/CompositorAnimationStorage.h b/gfx/layers/CompositorAnimationStorage.h index 9eb6a5ffa462..1450928573e1 100644 --- a/gfx/layers/CompositorAnimationStorage.h +++ b/gfx/layers/CompositorAnimationStorage.h @@ -187,7 +187,7 @@ class CompositorAnimationStorage final { AnimatedValueTable mAnimatedValues; AnimationsTable mAnimations; std::unordered_set mNewAnimations; - mutable Mutex mLock MOZ_UNANNOTATED; + mutable Mutex mLock; // CompositorBridgeParent owns this CompositorAnimationStorage instance. CompositorBridgeParent* MOZ_NON_OWNING_REF mCompositorBridge; }; diff --git a/gfx/layers/DMABUFSurfaceImage.cpp b/gfx/layers/DMABUFSurfaceImage.cpp index 792147344315..2e29ca13c185 100644 --- a/gfx/layers/DMABUFSurfaceImage.cpp +++ b/gfx/layers/DMABUFSurfaceImage.cpp @@ -38,7 +38,7 @@ DMABUFSurfaceImage::~DMABUFSurfaceImage() { } StaticRefPtr sSnapshotContext; -static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED; +static StaticMutex sSnapshotContextMutex; already_AddRefed DMABUFSurfaceImage::GetAsSourceSurface() { if (!sSnapshotContext) { diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index a4e1176a9b26..b95c157972f7 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -197,7 +197,7 @@ class BufferRecycleBin final { // This protects mRecycledBuffers, mRecycledBufferSize, mRecycledTextures // and mRecycledTextureSizes - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; // We should probably do something to prune this list on a timer so we don't // eat excess memory while video is paused... @@ -251,7 +251,7 @@ class ImageContainerListener final { ~ImageContainerListener(); - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; ImageContainer* mImageContainer; }; @@ -543,7 +543,7 @@ class ImageContainer final : public SupportsThreadSafeWeakPtr { // RecursiveMutex to protect thread safe access to the "current // image", and any other state which is shared between threads. - RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED; + RecursiveMutex mRecursiveMutex; RefPtr mRecycleAllocator; diff --git a/gfx/layers/NativeLayerCA.h b/gfx/layers/NativeLayerCA.h index 1fb4cf604e3e..43f5e4c91e52 100644 --- a/gfx/layers/NativeLayerCA.h +++ b/gfx/layers/NativeLayerCA.h @@ -146,7 +146,7 @@ class NativeLayerRootCA : public NativeLayerRoot { void UpdateMouseMovedRecently(const MutexAutoLock& aProofOfLock); - Mutex mMutex MOZ_UNANNOTATED; // protects all other fields + Mutex mMutex; // protects all other fields Representation mOnscreenRepresentation; Representation mOffscreenRepresentation; NativeLayerRootSnapshotterCA* mWeakSnapshotter = nullptr; @@ -381,7 +381,7 @@ class NativeLayerCA : public NativeLayer { void ForAllRepresentations(F aFn); // Controls access to all fields of this class. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Each IOSurface is initially created inside NextSurface. // The surface stays alive until the recycling mechanism in NextSurface diff --git a/gfx/layers/NativeLayerWayland.h b/gfx/layers/NativeLayerWayland.h index 0c45adc3119d..ce6686956cca 100644 --- a/gfx/layers/NativeLayerWayland.h +++ b/gfx/layers/NativeLayerWayland.h @@ -73,7 +73,7 @@ class NativeLayerRootWayland final : public NativeLayerRoot { bool CommitToScreen(const MutexAutoLock& aProofOfLock); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; MozContainer* mContainer = nullptr; wl_surface* mWlSurface = nullptr; @@ -147,7 +147,7 @@ class NativeLayerWayland final : public NativeLayer { void HandlePartialUpdate(const MutexAutoLock& aProofOfLock); void FrameCallbackHandler(wl_callback* aCallback, uint32_t aTime); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; const RefPtr mSurfacePoolHandle; const gfx::IntSize mSize; diff --git a/gfx/layers/ProfilerScreenshots.h b/gfx/layers/ProfilerScreenshots.h index 8239c704037f..6ffa0c25b0dc 100644 --- a/gfx/layers/ProfilerScreenshots.h +++ b/gfx/layers/ProfilerScreenshots.h @@ -101,7 +101,7 @@ class ProfilerScreenshots final { // threads, protected by mMutex. nsTArray> mAvailableSurfaces; // Protects mAvailableSurfaces. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // The total number of surfaces created. If encoding is fast enough to happen // entirely in the time between two calls to SubmitScreenshot, this should // never exceed 1. diff --git a/gfx/layers/SourceSurfaceSharedData.h b/gfx/layers/SourceSurfaceSharedData.h index 73743a839dbf..dabee2e67b27 100644 --- a/gfx/layers/SourceSurfaceSharedData.h +++ b/gfx/layers/SourceSurfaceSharedData.h @@ -326,7 +326,7 @@ class SourceSurfaceSharedData : public DataSourceSurface { */ void CloseHandleInternal(); - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; int32_t mStride; int32_t mHandleCount; Maybe mDirtyRect; diff --git a/gfx/layers/SurfacePoolWayland.h b/gfx/layers/SurfacePoolWayland.h index 6a746e732cd7..a5640ce0619c 100644 --- a/gfx/layers/SurfacePoolWayland.h +++ b/gfx/layers/SurfacePoolWayland.h @@ -63,7 +63,7 @@ class SurfacePoolWayland final : public SurfacePool { const MutexAutoLock& aProofOfLock, gl::GLContext* aGL, const gfx::IntSize& aSize, GLuint aTexture, bool aNeedsDepthBuffer); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Stores the entries for surfaces that are in use by NativeLayerWayland, i.e. // an entry is inside mInUseEntries between calls to ObtainSurfaceFromPool() diff --git a/gfx/layers/apz/public/APZSampler.h b/gfx/layers/apz/public/APZSampler.h index bd8f56732002..ddbe46e899c9 100644 --- a/gfx/layers/apz/public/APZSampler.h +++ b/gfx/layers/apz/public/APZSampler.h @@ -112,19 +112,19 @@ class APZSampler { // StaticAutoPtr wrapper on sWindowIdMap to avoid a static initializer for the // unordered_map. This also avoids the initializer/memory allocation in cases // where we're not using WebRender. - static StaticMutex sWindowIdLock MOZ_UNANNOTATED; + static StaticMutex sWindowIdLock; static StaticAutoPtr>> sWindowIdMap; Maybe mWindowId; // Lock used to protected mSamplerThreadId - mutable Mutex mThreadIdLock MOZ_UNANNOTATED; + mutable Mutex mThreadIdLock; // If WebRender is enabled, this holds the thread id of the render backend // thread (which is the sampler thread) for the compositor associated with // this APZSampler instance. Maybe mSamplerThreadId; - Mutex mSampleTimeLock MOZ_UNANNOTATED; + Mutex mSampleTimeLock; // Can only be accessed or modified while holding mSampleTimeLock. SampleTime mSampleTime; }; diff --git a/gfx/layers/apz/public/APZUpdater.h b/gfx/layers/apz/public/APZUpdater.h index 7b9a2eed500a..a7d6595da167 100644 --- a/gfx/layers/apz/public/APZUpdater.h +++ b/gfx/layers/apz/public/APZUpdater.h @@ -193,12 +193,12 @@ class APZUpdater { // StaticAutoPtr wrapper on sWindowIdMap to avoid a static initializer for the // unordered_map. This also avoids the initializer/memory allocation in cases // where we're not using WebRender. - static StaticMutex sWindowIdLock MOZ_UNANNOTATED; + static StaticMutex sWindowIdLock; static StaticAutoPtr> sWindowIdMap; Maybe mWindowId; // Lock used to protected mUpdaterThreadId; - mutable Mutex mThreadIdLock MOZ_UNANNOTATED; + mutable Mutex mThreadIdLock; // If WebRender and async scene building are enabled, this holds the thread id // of the scene builder thread (which is the updater thread) for the // compositor associated with this APZUpdater instance. It may be populated @@ -215,7 +215,7 @@ class APZUpdater { }; // Lock used to protect mUpdaterQueue - Mutex mQueueLock MOZ_UNANNOTATED; + Mutex mQueueLock; // Holds a queue of tasks to be run on the updater thread, when the updater // thread is a WebRender thread, since it won't have a message loop we can // dispatch to. Note that although this is a single queue it is conceptually diff --git a/gfx/layers/apz/src/APZCTreeManager.h b/gfx/layers/apz/src/APZCTreeManager.h index 7b082e2e56e4..8301555e35b9 100644 --- a/gfx/layers/apz/src/APZCTreeManager.h +++ b/gfx/layers/apz/src/APZCTreeManager.h @@ -774,7 +774,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { * mRootNode instance variable, as that is considered part of the APZC tree * management state. * IMPORTANT: See the note about lock ordering at the top of this file. */ - mutable mozilla::RecursiveMutex mTreeLock MOZ_UNANNOTATED; + mutable mozilla::RecursiveMutex mTreeLock; RefPtr mRootNode; /* @@ -796,7 +796,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { /** A lock that protects mApzcMap, mScrollThumbInfo, mRootScrollbarInfo, * mFixedPositionInfo, and mStickyPositionInfo. */ - mutable mozilla::Mutex mMapLock MOZ_UNANNOTATED; + mutable mozilla::Mutex mMapLock; /** * Helper structure to store a bunch of things in mApzcMap so that they can @@ -1003,7 +1003,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { // protected by the mTestDataLock. std::unordered_map, LayersId::HashFn> mTestData; - mutable mozilla::Mutex mTestDataLock MOZ_UNANNOTATED; + mutable mozilla::Mutex mTestDataLock; // This must only be touched on the controller thread. float mDPI; @@ -1015,7 +1015,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { // the generation is bumped up on the sampler theread which is per // APZCTreeManager. ScrollGenerationCounter mScrollGenerationCounter; - mozilla::Mutex mScrollGenerationLock MOZ_UNANNOTATED; + mozilla::Mutex mScrollGenerationLock; #if defined(MOZ_WIDGET_ANDROID) private: diff --git a/gfx/layers/apz/src/AsyncPanZoomController.h b/gfx/layers/apz/src/AsyncPanZoomController.h index d2f1c3621b3a..e4096b8a0774 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.h +++ b/gfx/layers/apz/src/AsyncPanZoomController.h @@ -964,7 +964,7 @@ class AsyncPanZoomController { updater thread. */ RefPtr mGeckoContentController; RefPtr mGestureEventListener; - mutable Monitor mRefPtrMonitor MOZ_UNANNOTATED; + mutable Monitor mRefPtrMonitor; // This is a raw pointer to avoid introducing a reference cycle between // AsyncPanZoomController and APZCTreeManager. Since these objects don't @@ -1013,7 +1013,7 @@ class AsyncPanZoomController { // be held before calling the CanScroll function of |mX| and |mY|. These // coupled relationships bring us the burden of taking care of when the // monitor should be held, so they should be decoupled in the future. - mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED; + mutable RecursiveMutex mRecursiveMutex; private: // Metadata of the container layer corresponding to this APZC. This is @@ -1754,7 +1754,7 @@ class AsyncPanZoomController { uint32_t aMagnitude); // Mutex protecting mCheckerboardEvent - Mutex mCheckerboardEventLock MOZ_UNANNOTATED; + Mutex mCheckerboardEventLock; // This is created when this APZC instance is first included as part of a // composite. If a checkerboard event takes place, this is destroyed at the // end of the event, and a new one is created on the next composite. diff --git a/gfx/layers/apz/src/CheckerboardEvent.h b/gfx/layers/apz/src/CheckerboardEvent.h index ad7fa83b2bd7..aeececcd6e14 100644 --- a/gfx/layers/apz/src/CheckerboardEvent.h +++ b/gfx/layers/apz/src/CheckerboardEvent.h @@ -198,7 +198,7 @@ class CheckerboardEvent final { * Monitor that needs to be acquired before touching mBufferedProperties * or mRendertraceInfo. */ - mutable Monitor mRendertraceLock MOZ_UNANNOTATED; + mutable Monitor mRendertraceLock; /** * A circular buffer to store some properties. This is used before the * checkerboarding actually starts, so that we have some data on what diff --git a/gfx/layers/apz/src/FocusState.h b/gfx/layers/apz/src/FocusState.h index 14d536be3e55..37c44ec69837 100644 --- a/gfx/layers/apz/src/FocusState.h +++ b/gfx/layers/apz/src/FocusState.h @@ -138,7 +138,7 @@ class FocusState final { private: // All methods should hold this lock, since this class is accessed via both // the updater and controller threads. - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; // The set of focus targets received indexed by their layer tree ID std::unordered_map mFocusTree; diff --git a/gfx/layers/apz/util/APZThreadUtils.cpp b/gfx/layers/apz/util/APZThreadUtils.cpp index f2b069e72df4..68f385f57162 100644 --- a/gfx/layers/apz/util/APZThreadUtils.cpp +++ b/gfx/layers/apz/util/APZThreadUtils.cpp @@ -19,7 +19,7 @@ namespace layers { static bool sThreadAssertionsEnabled = true; static StaticRefPtr sControllerThread; -static StaticMutex sControllerThreadMutex MOZ_UNANNOTATED; +static StaticMutex sControllerThreadMutex; /*static*/ void APZThreadUtils::SetThreadAssertionsEnabled(bool aEnabled) { diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index dc325cc57147..e0565ea8961b 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -472,7 +472,7 @@ void DeallocateTextureClient(TextureDeallocParams params) { if (ipdlThread && !ipdlThread->IsOnCurrentThread()) { if (params.syncDeallocation) { bool done = false; - ReentrantMonitor barrier MOZ_UNANNOTATED("DeallocateTextureClient"); + ReentrantMonitor barrier("DeallocateTextureClient"); ReentrantMonitorAutoEnter autoMon(barrier); ipdlThread->Dispatch(NewRunnableFunction( "DeallocateTextureClientSyncProxyRunnable", diff --git a/gfx/layers/client/TextureClientRecycleAllocator.h b/gfx/layers/client/TextureClientRecycleAllocator.h index 4abaa60c4e7c..37a5f26a7f5c 100644 --- a/gfx/layers/client/TextureClientRecycleAllocator.h +++ b/gfx/layers/client/TextureClientRecycleAllocator.h @@ -130,7 +130,7 @@ class TextureClientRecycleAllocator : public ITextureClientRecycleAllocator { // stack is good from Graphics cache usage point of view. std::stack > mPooledClients; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; bool mIsDestroyed; }; diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h index 7b176846e8dd..9cbeb335d9b1 100644 --- a/gfx/layers/d3d11/TextureD3D11.h +++ b/gfx/layers/d3d11/TextureD3D11.h @@ -509,7 +509,7 @@ class SyncObjectD3D11Client : public SyncObjectClient { explicit SyncObjectD3D11Client(SyncHandle aSyncHandle); bool Init(ID3D11Device* aDevice, bool aFallible); bool SynchronizeInternal(ID3D11Device* aDevice, bool aFallible); - Mutex mSyncLock MOZ_UNANNOTATED; + Mutex mSyncLock; RefPtr mSyncTexture; std::vector mSyncedTextures; diff --git a/gfx/layers/ipc/CompositableInProcessManager.h b/gfx/layers/ipc/CompositableInProcessManager.h index e5257a985eb7..9c6f24a4ffa2 100644 --- a/gfx/layers/ipc/CompositableInProcessManager.h +++ b/gfx/layers/ipc/CompositableInProcessManager.h @@ -59,7 +59,7 @@ class CompositableInProcessManager final { static std::map, RefPtr> sCompositables; - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; static uint32_t sNamespace; static Atomic sNextResourceId; diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h index 41d45e25b8a8..57cefb64bf78 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -696,8 +696,8 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase, CompositorOptions mOptions; - mozilla::Monitor mPauseCompositionMonitor MOZ_UNANNOTATED; - mozilla::Monitor mResumeCompositionMonitor MOZ_UNANNOTATED; + mozilla::Monitor mPauseCompositionMonitor; + mozilla::Monitor mResumeCompositionMonitor; uint64_t mCompositorBridgeID; LayersId mRootLayerTreeID; diff --git a/gfx/layers/ipc/CompositorManagerParent.h b/gfx/layers/ipc/CompositorManagerParent.h index 8678994ddefd..cf0bdf6be16d 100644 --- a/gfx/layers/ipc/CompositorManagerParent.h +++ b/gfx/layers/ipc/CompositorManagerParent.h @@ -65,7 +65,7 @@ class CompositorManagerParent final : public PCompositorManagerParent { private: static StaticRefPtr sInstance; - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; #ifdef COMPOSITOR_MANAGER_PARENT_EXPLICIT_SHUTDOWN static StaticAutoPtr> sActiveActors; diff --git a/gfx/layers/ipc/CompositorVsyncScheduler.h b/gfx/layers/ipc/CompositorVsyncScheduler.h index 8b6d2a8b6d1f..2db6ff3a07fd 100644 --- a/gfx/layers/ipc/CompositorVsyncScheduler.h +++ b/gfx/layers/ipc/CompositorVsyncScheduler.h @@ -150,7 +150,7 @@ class CompositorVsyncScheduler { private: virtual ~Observer(); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Hold raw pointer to avoid mutual reference. CompositorVsyncScheduler* mOwner; }; @@ -170,12 +170,12 @@ class CompositorVsyncScheduler { widget::CompositorWidget* mWidget; RefPtr mVsyncObserver; - mozilla::Monitor mCurrentCompositeTaskMonitor MOZ_UNANNOTATED; + mozilla::Monitor mCurrentCompositeTaskMonitor; RefPtr mCurrentCompositeTask; // Accessed on multiple threads, guarded by mCurrentCompositeTaskMonitor. wr::RenderReasons mCurrentCompositeTaskReasons; - mozilla::Monitor mCurrentVRTaskMonitor MOZ_UNANNOTATED; + mozilla::Monitor mCurrentVRTaskMonitor; RefPtr mCurrentVRTask; }; diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index 9109046906a1..a167bda121d5 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -178,7 +178,7 @@ void ImageBridgeChild::CancelWaitForNotifyNotUsed(uint64_t aTextureId) { } // Singleton -static StaticMutex sImageBridgeSingletonLock MOZ_UNANNOTATED; +static StaticMutex sImageBridgeSingletonLock; static StaticRefPtr sImageBridgeChildSingleton; static StaticRefPtr sImageBridgeChildThread; diff --git a/gfx/layers/ipc/ImageBridgeChild.h b/gfx/layers/ipc/ImageBridgeChild.h index 1f33e2677272..01ea2c11787c 100644 --- a/gfx/layers/ipc/ImageBridgeChild.h +++ b/gfx/layers/ipc/ImageBridgeChild.h @@ -354,7 +354,7 @@ class ImageBridgeChild final : public PImageBridgeChild, /** * Mapping from async compositable IDs to image containers. */ - Mutex mContainerMapLock MOZ_UNANNOTATED; + Mutex mContainerMapLock; std::unordered_map> mImageContainerListeners; RefPtr FindListener( diff --git a/gfx/layers/ipc/LayerTreeOwnerTracker.h b/gfx/layers/ipc/LayerTreeOwnerTracker.h index 651c695309ed..a3454f250585 100644 --- a/gfx/layers/ipc/LayerTreeOwnerTracker.h +++ b/gfx/layers/ipc/LayerTreeOwnerTracker.h @@ -63,7 +63,7 @@ class LayerTreeOwnerTracker final { private: LayerTreeOwnerTracker(); - mozilla::Mutex mLayerIdsLock MOZ_UNANNOTATED; + mozilla::Mutex mLayerIdsLock; std::map mLayerIds; }; diff --git a/gfx/layers/ipc/SharedSurfacesParent.h b/gfx/layers/ipc/SharedSurfacesParent.h index 1ccc99b2f0eb..a4196690bc13 100644 --- a/gfx/layers/ipc/SharedSurfacesParent.h +++ b/gfx/layers/ipc/SharedSurfacesParent.h @@ -91,7 +91,7 @@ class SharedSurfacesParent final { static void ExpireMap( nsTArray>& aExpired); - static StaticMonitor sMonitor MOZ_UNANNOTATED; + static StaticMonitor sMonitor; static StaticAutoPtr sInstance; diff --git a/gfx/layers/ipc/SynchronousTask.h b/gfx/layers/ipc/SynchronousTask.h index 41ad9fa5b28b..fc6acda81b09 100644 --- a/gfx/layers/ipc/SynchronousTask.h +++ b/gfx/layers/ipc/SynchronousTask.h @@ -33,7 +33,7 @@ class MOZ_STACK_CLASS SynchronousTask { } private: - ReentrantMonitor mMonitor MOZ_UNANNOTATED; + ReentrantMonitor mMonitor; ReentrantMonitorAutoEnter mAutoEnter; bool mDone; }; diff --git a/gfx/layers/wr/AsyncImagePipelineManager.h b/gfx/layers/wr/AsyncImagePipelineManager.h index 0a9efe38691a..57797dbe2f8b 100644 --- a/gfx/layers/wr/AsyncImagePipelineManager.h +++ b/gfx/layers/wr/AsyncImagePipelineManager.h @@ -263,7 +263,7 @@ class AsyncImagePipelineManager final { std::vector> mRenderSubmittedUpdates; - Mutex mRenderSubmittedUpdatesLock MOZ_UNANNOTATED; + Mutex mRenderSubmittedUpdatesLock; Atomic mLastCompletedFrameId; std::vector mController; // Can only be accessed or modified while holding mStorageLock. RefPtr mAnimStorage; - mutable Mutex mStorageLock MOZ_UNANNOTATED; + mutable Mutex mStorageLock; // Used to manage the mapping from a WR window id to OMTASampler. These are // only used if WebRender is enabled. Both sWindowIdMap and mWindowId should @@ -127,19 +127,19 @@ class OMTASampler final { // StaticAutoPtr wrapper on sWindowIdMap to avoid a static initializer for the // unordered_map. This also avoids the initializer/memory allocation in cases // where we're not using WebRender. - static StaticMutex sWindowIdLock MOZ_UNANNOTATED; + static StaticMutex sWindowIdLock; static StaticAutoPtr>> sWindowIdMap; Maybe mWindowId; // Lock used to protected mSamplerThreadId - mutable Mutex mThreadIdLock MOZ_UNANNOTATED; + mutable Mutex mThreadIdLock; // If WebRender is enabled, this holds the thread id of the render backend // thread (which is the sampler thread) for the compositor associated with // this OMTASampler instance. Maybe mSamplerThreadId; - Mutex mSampleTimeLock MOZ_UNANNOTATED; + Mutex mSampleTimeLock; // Can only be accessed or modified while holding mSampleTimeLock. TimeStamp mSampleTime; // Same as |mSampleTime|, can only be accessed or modified while holding diff --git a/gfx/src/gfxCrashReporterUtils.cpp b/gfx/src/gfxCrashReporterUtils.cpp index dcc97c2f08bd..e89d3769a98f 100644 --- a/gfx/src/gfxCrashReporterUtils.cpp +++ b/gfx/src/gfxCrashReporterUtils.cpp @@ -27,7 +27,7 @@ namespace mozilla { static nsTArray* gFeaturesAlreadyReported = nullptr; -static StaticMutex gFeaturesAlreadyReportedMutex MOZ_UNANNOTATED; +static StaticMutex gFeaturesAlreadyReportedMutex; class ObserverToDestroyFeaturesAlreadyReported final : public nsIObserver { public: diff --git a/gfx/tests/gtest/TestVsync.cpp b/gfx/tests/gtest/TestVsync.cpp index 94eb354c8a7c..05b23d0d0bd7 100644 --- a/gfx/tests/gtest/TestVsync.cpp +++ b/gfx/tests/gtest/TestVsync.cpp @@ -67,7 +67,7 @@ class TestVsyncObserver : public VsyncObserver { bool mDidGetVsyncNotification; private: - Monitor mVsyncMonitor MOZ_UNANNOTATED; + Monitor mVsyncMonitor; }; class VsyncTester : public ::testing::Test { diff --git a/gfx/thebes/DeviceManagerDx.h b/gfx/thebes/DeviceManagerDx.h index 9e3187877a39..f33db20bdf36 100644 --- a/gfx/thebes/DeviceManagerDx.h +++ b/gfx/thebes/DeviceManagerDx.h @@ -172,7 +172,7 @@ class DeviceManagerDx final { nsModuleHandle mDcompModule; - mozilla::Mutex mDeviceLock MOZ_UNANNOTATED; + mozilla::Mutex mDeviceLock; nsTArray mFeatureLevels; RefPtr mAdapter; RefPtr mCompositorDevice; diff --git a/gfx/thebes/VsyncSource.h b/gfx/thebes/VsyncSource.h index fefd04486920..7006e14ea8ab 100644 --- a/gfx/thebes/VsyncSource.h +++ b/gfx/thebes/VsyncSource.h @@ -94,7 +94,7 @@ class VsyncSource { private: void UpdateVsyncStatus(); - Mutex mDispatcherLock MOZ_UNANNOTATED; + Mutex mDispatcherLock; bool mRefreshTimerNeedsVsync; nsTArray> mEnabledCompositorVsyncDispatchers; diff --git a/gfx/thebes/gfxDWriteCommon.cpp b/gfx/thebes/gfxDWriteCommon.cpp index ee81f15680ef..3092ba3e222f 100644 --- a/gfx/thebes/gfxDWriteCommon.cpp +++ b/gfx/thebes/gfxDWriteCommon.cpp @@ -13,7 +13,7 @@ class gfxDWriteFontFileStream; -static mozilla::StaticMutex sFontFileStreamsMutex MOZ_UNANNOTATED; +static mozilla::StaticMutex sFontFileStreamsMutex; static uint64_t sNextFontFileKey = 0; static std::unordered_map sFontFileStreams; diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 2f14ed83d859..3f6491e9763e 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -209,7 +209,7 @@ class CrashStatsLogForwarder : public mozilla::gfx::LogForwarder { CrashReporter::Annotation mCrashCriticalKey; uint32_t mMaxCapacity; int32_t mIndex; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; CrashStatsLogForwarder::CrashStatsLogForwarder(CrashReporter::Annotation aKey) diff --git a/gfx/thebes/gfxPlatformFontList.h b/gfx/thebes/gfxPlatformFontList.h index 3bfef70d5cad..6fa68cc906fe 100644 --- a/gfx/thebes/gfxPlatformFontList.h +++ b/gfx/thebes/gfxPlatformFontList.h @@ -867,7 +867,7 @@ class gfxPlatformFontList : public gfxFontInfoLoader { nsAtom* aLanguage = nullptr) = 0; // Protects mFontFamilies. - mozilla::Mutex mFontFamiliesMutex MOZ_UNANNOTATED; + mozilla::Mutex mFontFamiliesMutex; // canonical family name ==> family entry (unique, one name per family entry) FontFamilyTable mFontFamilies; diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 35d9cdeba4f1..f17beac6ec88 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -845,10 +845,10 @@ class GtkVsyncSource final : public VsyncSource { // Owned by the vsync thread. RefPtr mGLContext; _XDisplay* mXDisplay; - Monitor mSetupLock MOZ_UNANNOTATED; + Monitor mSetupLock; base::Thread mVsyncThread; RefPtr mVsyncTask; - Monitor mVsyncEnabledLock MOZ_UNANNOTATED; + Monitor mVsyncEnabledLock; bool mVsyncEnabled; }; diff --git a/gfx/vr/VRManager.h b/gfx/vr/VRManager.h index c7a5bb5f0d18..09768ba0e301 100644 --- a/gfx/vr/VRManager.h +++ b/gfx/vr/VRManager.h @@ -159,7 +159,7 @@ class VRManager : nsIObserver { bool mFrameStarted; uint32_t mTaskInterval; RefPtr mTaskTimer; - mozilla::Monitor mCurrentSubmitTaskMonitor MOZ_UNANNOTATED; + mozilla::Monitor mCurrentSubmitTaskMonitor; RefPtr mCurrentSubmitTask; uint64_t mLastSubmittedFrameId; uint64_t mLastStartedFrame; diff --git a/gfx/vr/VRPuppetCommandBuffer.h b/gfx/vr/VRPuppetCommandBuffer.h index baa3063c9a98..6acbcbe80dca 100644 --- a/gfx/vr/VRPuppetCommandBuffer.h +++ b/gfx/vr/VRPuppetCommandBuffer.h @@ -208,7 +208,7 @@ class VRPuppetCommandBuffer { void SimulateHaptics(double aDeltaTime); void CompleteTest(bool aTimedOut); nsTArray mBuffer; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; VRSystemState mPendingState; VRSystemState mCommittedState; double mHapticPulseRemaining[kVRControllerMaxCount][kNumPuppetHaptics]; diff --git a/gfx/vr/service/OpenVRSession.h b/gfx/vr/service/OpenVRSession.h index dc58b5d7fd0e..60ddcf4b290c 100644 --- a/gfx/vr/service/OpenVRSession.h +++ b/gfx/vr/service/OpenVRSession.h @@ -102,7 +102,7 @@ class OpenVRSession : public VRSession { void StopHapticTimer(); RefPtr mHapticTimer; RefPtr mHapticThread; - mozilla::Mutex mControllerHapticStateMutex MOZ_UNANNOTATED; + mozilla::Mutex mControllerHapticStateMutex; UniquePtr mControllerMapper; }; diff --git a/gfx/webrender_bindings/RenderThread.h b/gfx/webrender_bindings/RenderThread.h index 1b935505761b..8b5b9ff7f551 100644 --- a/gfx/webrender_bindings/RenderThread.h +++ b/gfx/webrender_bindings/RenderThread.h @@ -360,7 +360,7 @@ class RenderThread final { } }; - Mutex mRenderTextureMapLock MOZ_UNANNOTATED; + Mutex mRenderTextureMapLock; std::unordered_map, ExternalImageIdHashFn> mRenderTextures; diff --git a/image/AnimationSurfaceProvider.h b/image/AnimationSurfaceProvider.h index 920638279ec2..b104049afa71 100644 --- a/image/AnimationSurfaceProvider.h +++ b/image/AnimationSurfaceProvider.h @@ -113,13 +113,13 @@ class AnimationSurfaceProvider final : public ISurfaceProvider, RefPtr mImage; /// A mutex to protect mDecoder. Always taken before mFramesMutex. - mutable Mutex mDecodingMutex MOZ_UNANNOTATED; + mutable Mutex mDecodingMutex; /// The decoder used to decode this animation. RefPtr mDecoder; /// A mutex to protect mFrames. Always taken after mDecodingMutex. - mutable Mutex mFramesMutex MOZ_UNANNOTATED; + mutable Mutex mFramesMutex; /// The frames of this animation, in order. UniquePtr mFrames; diff --git a/image/DecodePool.h b/image/DecodePool.h index 3ce1bf943017..cbbcdd784a7e 100644 --- a/image/DecodePool.h +++ b/image/DecodePool.h @@ -98,7 +98,7 @@ class DecodePool final : public nsIObserver { bool mShuttingDown = false; // mMutex protects mIOThread. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsCOMPtr mIOThread; }; diff --git a/image/DecodedSurfaceProvider.h b/image/DecodedSurfaceProvider.h index 07e722daa6ed..a00a746001a6 100644 --- a/image/DecodedSurfaceProvider.h +++ b/image/DecodedSurfaceProvider.h @@ -75,7 +75,7 @@ class DecodedSurfaceProvider final : public ISurfaceProvider, RefPtr mImage; /// Mutex protecting access to mDecoder. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; /// The decoder that will generate our surface. Dropped after decoding. RefPtr mDecoder; diff --git a/image/IDecodingTask.h b/image/IDecodingTask.h index b3bce74757e4..d4199dbcfbf7 100644 --- a/image/IDecodingTask.h +++ b/image/IDecodingTask.h @@ -86,7 +86,7 @@ class MetadataDecodingTask final : public IDecodingTask { virtual ~MetadataDecodingTask() {} /// Mutex protecting access to mDecoder. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; NotNull> mDecoder; }; diff --git a/image/ProgressTracker.h b/image/ProgressTracker.h index 568fb5e28c26..4c9b9b3e578c 100644 --- a/image/ProgressTracker.h +++ b/image/ProgressTracker.h @@ -226,7 +226,7 @@ class ProgressTracker : public mozilla::SupportsWeakPtr { RefPtr mRunnable; // mMutex protects access to mImage and mEventTarget. - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; // mImage is a weak ref; it should be set to null when the image goes out of // scope. diff --git a/image/SourceBuffer.h b/image/SourceBuffer.h index 55d974636335..c218edda93e1 100644 --- a/image/SourceBuffer.h +++ b/image/SourceBuffer.h @@ -475,7 +475,7 @@ class SourceBuffer final { ////////////////////////////////////////////////////////////////////////////// /// All private members are protected by mMutex. - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; /// The data in this SourceBuffer, stored as a series of Chunks. AutoTArray mChunks; diff --git a/image/SurfaceCache.cpp b/image/SurfaceCache.cpp index 36dc579048b5..95ac62c627a8 100644 --- a/image/SurfaceCache.cpp +++ b/image/SurfaceCache.cpp @@ -60,7 +60,7 @@ class SurfaceCacheImpl; static StaticRefPtr sInstance; // The mutex protecting the surface cache. -static StaticMutex sInstanceMutex MOZ_UNANNOTATED; +static StaticMutex sInstanceMutex; /////////////////////////////////////////////////////////////////////////////// // SurfaceCache Implementation diff --git a/image/encoders/jpeg/nsJPEGEncoder.h b/image/encoders/jpeg/nsJPEGEncoder.h index df543d957b64..e0c17ef624ad 100644 --- a/image/encoders/jpeg/nsJPEGEncoder.h +++ b/image/encoders/jpeg/nsJPEGEncoder.h @@ -68,7 +68,7 @@ class nsJPEGEncoder final : public imgIEncoder { // another reads from it. We lock to ensure that the buffer remains // append-only while we read from it (that it is not realloced) and to ensure // that only one thread dispatches a callback for each call to AsyncWait. - ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + ReentrantMonitor mReentrantMonitor; }; #endif // mozilla_image_encoders_jpeg_nsJPEGEncoder_h diff --git a/image/encoders/png/nsPNGEncoder.h b/image/encoders/png/nsPNGEncoder.h index 76d695ccfae1..c73d8a62b653 100644 --- a/image/encoders/png/nsPNGEncoder.h +++ b/image/encoders/png/nsPNGEncoder.h @@ -74,6 +74,6 @@ class nsPNGEncoder final : public imgIEncoder { // append-only while we read from it (that it is not realloced) and to // ensure that only one thread dispatches a callback for each call to // AsyncWait. - ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + ReentrantMonitor mReentrantMonitor; }; #endif // mozilla_image_encoders_png_nsPNGEncoder_h diff --git a/image/encoders/webp/nsWebPEncoder.h b/image/encoders/webp/nsWebPEncoder.h index 8628d12388ae..0fb8f1bfd8b0 100644 --- a/image/encoders/webp/nsWebPEncoder.h +++ b/image/encoders/webp/nsWebPEncoder.h @@ -58,6 +58,6 @@ class nsWebPEncoder final : public imgIEncoder { // append-only while we read from it (that it is not realloced) and to // ensure that only one thread dispatches a callback for each call to // AsyncWait. - ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + ReentrantMonitor mReentrantMonitor; }; #endif // mozilla_image_encoders_webp_nsWebPEncoder_h diff --git a/image/imgFrame.h b/image/imgFrame.h index 4ecb9e0d7299..a1c7979fc5b5 100644 --- a/image/imgFrame.h +++ b/image/imgFrame.h @@ -219,7 +219,7 @@ class imgFrame { // Thread-safe mutable data, protected by mMonitor. ////////////////////////////////////////////////////////////////////////////// - mutable Monitor mMonitor MOZ_UNANNOTATED; + mutable Monitor mMonitor; /** * Used for rasterized images, this contains the raw pixel data. diff --git a/image/imgLoader.h b/image/imgLoader.h index 9b3515a9066a..05ff6dba7ec0 100644 --- a/image/imgLoader.h +++ b/image/imgLoader.h @@ -417,7 +417,7 @@ class imgLoader final : public imgILoader, // The imgRequest can have refs to them held on non-main thread, so we need // a mutex because we modify the uncached images set from the imgRequest // destructor. - Mutex mUncachedImagesMutex MOZ_UNANNOTATED; + Mutex mUncachedImagesMutex; static double sCacheTimeWeight; static uint32_t sCacheMaxSize; diff --git a/image/imgRequest.h b/image/imgRequest.h index e3ac3cb84b9f..e372940435e8 100644 --- a/image/imgRequest.h +++ b/image/imgRequest.h @@ -278,7 +278,7 @@ class imgRequest final : public nsIStreamListener, bool mIsDeniedCrossSiteCORSRequest; bool mIsCrossSiteNoCORSRequest; - mutable mozilla::Mutex mMutex MOZ_UNANNOTATED; + mutable mozilla::Mutex mMutex; // Member variables protected by mMutex. Note that *all* flags in our bitfield // are protected by mMutex; if you're adding a new flag that isn'protected, it diff --git a/intl/strres/nsStringBundle.cpp b/intl/strres/nsStringBundle.cpp index 0e8a277b1fea..7579ae9b2e38 100644 --- a/intl/strres/nsStringBundle.cpp +++ b/intl/strres/nsStringBundle.cpp @@ -138,7 +138,7 @@ class StringBundleProxy : public nsIStringBundle { virtual ~StringBundleProxy() = default; private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsCOMPtr mTarget; // Atomically reads mTarget and returns a strong reference to it. This diff --git a/intl/strres/nsStringBundle.h b/intl/strres/nsStringBundle.h index 0a8a7b62f4f3..c5a847b7c7a2 100644 --- a/intl/strres/nsStringBundle.h +++ b/intl/strres/nsStringBundle.h @@ -53,7 +53,7 @@ class nsStringBundleBase : public nsIStringBundle, public nsIMemoryReporter { void RegisterMemoryReporter(); nsCString mPropertiesURL; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; bool mAttemptedLoad; bool mLoaded; diff --git a/ipc/chromium/gtest/ports_unittest.cc b/ipc/chromium/gtest/ports_unittest.cc index b99ddd78e098..39b556253fcb 100644 --- a/ipc/chromium/gtest/ports_unittest.cc +++ b/ipc/chromium/gtest/ports_unittest.cc @@ -306,7 +306,7 @@ class TestNode : public NodeDelegate { base::WaitableEvent idle_event_; // Guards fields below. - mozilla::Mutex lock_ MOZ_UNANNOTATED{"TestNode"}; + mozilla::Mutex lock_{"TestNode"}; bool started_ = false; bool dispatching_ = false; bool should_quit_ = false; @@ -445,9 +445,9 @@ class PortsTest : public testing::Test, public MessageRouter { // Acquired before any operation which makes a Node busy, and before testing // if all nodes are idle. - mozilla::Mutex global_lock_ MOZ_UNANNOTATED{"PortsTest Global Lock"}; + mozilla::Mutex global_lock_{"PortsTest Global Lock"}; - mozilla::Mutex lock_ MOZ_UNANNOTATED{"PortsTest Lock"}; + mozilla::Mutex lock_{"PortsTest Lock"}; std::map nodes_; }; diff --git a/ipc/chromium/src/base/at_exit.h b/ipc/chromium/src/base/at_exit.h index f0c0a6311468..6e3d0bed2a8c 100644 --- a/ipc/chromium/src/base/at_exit.h +++ b/ipc/chromium/src/base/at_exit.h @@ -64,7 +64,7 @@ class AtExitManager { void* param_; }; - mozilla::Mutex lock_ MOZ_UNANNOTATED; + mozilla::Mutex lock_; std::stack stack_; AtExitManager* next_manager_; // Stack of managers to allow shadowing. diff --git a/ipc/chromium/src/base/message_loop.cc b/ipc/chromium/src/base/message_loop.cc index 22f823d04eea..dfa43300eac0 100644 --- a/ipc/chromium/src/base/message_loop.cc +++ b/ipc/chromium/src/base/message_loop.cc @@ -111,7 +111,7 @@ class MessageLoop::EventTarget : public nsISerialEventTarget, mLoop = nullptr; } - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; MessageLoop* mLoop; }; diff --git a/ipc/chromium/src/base/message_loop.h b/ipc/chromium/src/base/message_loop.h index 9c45fbfdfc6f..bbfbac6f45d8 100644 --- a/ipc/chromium/src/base/message_loop.h +++ b/ipc/chromium/src/base/message_loop.h @@ -423,7 +423,7 @@ class MessageLoop : public base::MessagePump::Delegate { // will be handled by the TimerManager. TaskQueue incoming_queue_; // Protect access to incoming_queue_. - mozilla::Mutex incoming_queue_lock_ MOZ_UNANNOTATED; + mozilla::Mutex incoming_queue_lock_; RunState* state_; int run_depth_base_; diff --git a/ipc/chromium/src/base/time_win.cc b/ipc/chromium/src/base/time_win.cc index c3e865143012..0f52a6ebd7bf 100644 --- a/ipc/chromium/src/base/time_win.cc +++ b/ipc/chromium/src/base/time_win.cc @@ -236,7 +236,7 @@ class NowSingleton { // to use StaticMutex (which is not leak-checked), but StaticMutex can't // be a member variable. So we have to have this separate variable and // pass it into the NowSingleton constructor. - static mozilla::StaticMutex mutex MOZ_UNANNOTATED; + static mozilla::StaticMutex mutex; static NowSingleton now(mutex); return now; } diff --git a/ipc/chromium/src/mojo/core/ports/node.h b/ipc/chromium/src/mojo/core/ports/node.h index fbbc8f65f7bf..d31b6dfba127 100644 --- a/ipc/chromium/src/mojo/core/ports/node.h +++ b/ipc/chromium/src/mojo/core/ports/node.h @@ -287,7 +287,7 @@ class Node { // Because UserMessage events may execute arbitrary user code during // destruction, it is also important to ensure that such events are never // destroyed while this (or any individual Port) lock is held. - mozilla::Mutex ports_lock_ MOZ_UNANNOTATED{"Ports Lock"}; + mozilla::Mutex ports_lock_{"Ports Lock"}; std::unordered_map> ports_; // Maps a peer port name to a list of PortRefs for all local ports which have diff --git a/ipc/chromium/src/mojo/core/ports/port.h b/ipc/chromium/src/mojo/core/ports/port.h index a54d99863237..b74c23f00b6a 100644 --- a/ipc/chromium/src/mojo/core/ports/port.h +++ b/ipc/chromium/src/mojo/core/ports/port.h @@ -188,7 +188,7 @@ class Port { ~Port(); - mozilla::Mutex lock_ MOZ_UNANNOTATED{"Port State"}; + mozilla::Mutex lock_{"Port State"}; }; } // namespace ports diff --git a/ipc/glue/BrowserProcessSubThread.h b/ipc/glue/BrowserProcessSubThread.h index 6397f42d205e..03e56f617f55 100644 --- a/ipc/glue/BrowserProcessSubThread.h +++ b/ipc/glue/BrowserProcessSubThread.h @@ -45,7 +45,7 @@ class BrowserProcessSubThread : public base::Thread { // This lock protects |browser_threads_|. Do not read or modify that array // without holding this lock. Do not block while holding this lock. - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; // An array of the ChromeThread objects. This array is protected by |lock_|. // The threads are not owned by this array. Typically, the threads are owned diff --git a/ipc/glue/CrashReporterClient.h b/ipc/glue/CrashReporterClient.h index e47ec94bd7f0..b771dcb7a200 100644 --- a/ipc/glue/CrashReporterClient.h +++ b/ipc/glue/CrashReporterClient.h @@ -40,7 +40,7 @@ class CrashReporterClient { ~CrashReporterClient(); private: - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; static StaticRefPtr sClientSingleton; }; diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index fb778c85d2ff..4e4cfd0bfa79 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -881,7 +881,7 @@ void BaseProcessLauncher::GetChildLogName(const char* origLogName, #if defined(XP_WIN) || defined(MOZ_WIDGET_ANDROID) || \ defined(MOZ_ENABLE_FORKSERVER) -static mozilla::StaticMutex gIPCLaunchThreadMutex MOZ_UNANNOTATED; +static mozilla::StaticMutex gIPCLaunchThreadMutex; static mozilla::StaticRefPtr gIPCLaunchThread; class IPCLaunchThreadObserver final : public nsIObserver { diff --git a/ipc/glue/GeckoChildProcessHost.h b/ipc/glue/GeckoChildProcessHost.h index f55de551b05c..a586b829b309 100644 --- a/ipc/glue/GeckoChildProcessHost.h +++ b/ipc/glue/GeckoChildProcessHost.h @@ -189,7 +189,7 @@ class GeckoChildProcessHost : public ChildProcessHost, ~GeckoChildProcessHost(); GeckoProcessType mProcessType; bool mIsFileContent; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; FilePath mProcessPath; // GeckoChildProcessHost holds the launch options so they can be set // up on the main thread using main-thread-only APIs like prefs, and @@ -287,7 +287,7 @@ class GeckoChildProcessHost : public ChildProcessHost, static uint32_t sNextUniqueID; static StaticAutoPtr> sGeckoChildProcessHosts; - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; }; nsCOMPtr GetIPCLauncher(); diff --git a/ipc/glue/IPCStreamDestination.cpp b/ipc/glue/IPCStreamDestination.cpp index 16653cd489be..c6c87cbc3811 100644 --- a/ipc/glue/IPCStreamDestination.cpp +++ b/ipc/glue/IPCStreamDestination.cpp @@ -185,7 +185,7 @@ class IPCStreamDestination::DelayedStartInputStream final nsCOMPtr mAsyncWaitCallback; // This protects mDestination: any method can be called by any thread. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; class HelperRunnable; }; diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp index ef3ac6dd839f..bf1d941ba33a 100644 --- a/ipc/glue/MessageChannel.cpp +++ b/ipc/glue/MessageChannel.cpp @@ -346,7 +346,7 @@ class ChannelCountReporter final : public nsIMemoryReporter { using CountTable = nsTHashMap; - static StaticMutex sChannelCountMutex MOZ_UNANNOTATED; + static StaticMutex sChannelCountMutex; static CountTable* sChannelCounts; public: diff --git a/ipc/glue/MessagePump.h b/ipc/glue/MessagePump.h index 162aba83d6c4..0b7ff11902bf 100644 --- a/ipc/glue/MessagePump.h +++ b/ipc/glue/MessagePump.h @@ -134,7 +134,7 @@ class MessagePumpForNonMainUIThreads final : public base::MessagePumpForUI, ~MessagePumpForNonMainUIThreads() {} bool mInWait; - mozilla::Mutex mWaitLock MOZ_UNANNOTATED; + mozilla::Mutex mWaitLock; }; #endif // defined(XP_WIN) diff --git a/ipc/ipdl/test/cxx/TestCrashCleanup.cpp b/ipc/ipdl/test/cxx/TestCrashCleanup.cpp index 6a19cc0f6565..6807bd296dc7 100644 --- a/ipc/ipdl/test/cxx/TestCrashCleanup.cpp +++ b/ipc/ipdl/test/cxx/TestCrashCleanup.cpp @@ -37,7 +37,7 @@ void DeleteTheWorld() { // needs to be synchronous to avoid affecting event ordering on // the main thread - Mutex mutex MOZ_UNANNOTATED("TestCrashCleanup.DeleteTheWorld.mutex"); + Mutex mutex("TestCrashCleanup.DeleteTheWorld.mutex"); CondVar cvar(mutex, "TestCrashCleanup.DeleteTheWorld.cvar"); MutexAutoLock lock(mutex); diff --git a/ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp b/ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp index 3af7ad620d92..30a90e8928b6 100644 --- a/ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp +++ b/ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp @@ -37,7 +37,7 @@ void DeleteTheWorld() { // needs to be synchronous to avoid affecting event ordering on // the main thread - Mutex mutex MOZ_UNANNOTATED("TestInterruptErrorCleanup.DeleteTheWorld.mutex"); + Mutex mutex("TestInterruptErrorCleanup.DeleteTheWorld.mutex"); CondVar cvar(mutex, "TestInterruptErrorCleanup.DeleteTheWorld.cvar"); MutexAutoLock lock(mutex); diff --git a/ipc/mscom/Interceptor.cpp b/ipc/mscom/Interceptor.cpp index 259d672683b6..60fc7f92c6bd 100644 --- a/ipc/mscom/Interceptor.cpp +++ b/ipc/mscom/Interceptor.cpp @@ -64,7 +64,7 @@ class LiveSet final { } private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsRefPtrHashtable, IWeakReference> mLiveSet; }; diff --git a/ipc/mscom/Interceptor.h b/ipc/mscom/Interceptor.h index 8ab578092bd3..d61c21f1ea3a 100644 --- a/ipc/mscom/Interceptor.h +++ b/ipc/mscom/Interceptor.h @@ -167,12 +167,10 @@ class Interceptor final : public WeakReferenceSupport, private: InterceptorTargetPtr mTarget; RefPtr mEventSink; - mozilla::Mutex mInterceptorMapMutex - MOZ_UNANNOTATED; // Guards mInterceptorMap + mozilla::Mutex mInterceptorMapMutex; // Guards mInterceptorMap // Using a nsTArray since the # of interfaces is not going to be very high nsTArray mInterceptorMap; - mozilla::Mutex mStdMarshalMutex - MOZ_UNANNOTATED; // Guards mStdMarshalUnk and mStdMarshal + mozilla::Mutex mStdMarshalMutex; // Guards mStdMarshalUnk and mStdMarshal RefPtr mStdMarshalUnk; IMarshal* mStdMarshal; // WEAK static MOZ_THREAD_LOCAL(bool) tlsCreatingStdMarshal; diff --git a/ipc/mscom/InterceptorLog.cpp b/ipc/mscom/InterceptorLog.cpp index ffd82c8a1dc3..6d0bdb31ca8a 100644 --- a/ipc/mscom/InterceptorLog.cpp +++ b/ipc/mscom/InterceptorLog.cpp @@ -92,7 +92,7 @@ class Logger final { nsCOMPtr mLogFileName; nsCOMPtr mLogFile; // Only accessed by mThread - Mutex mMutex MOZ_UNANNOTATED; // Guards mThread and mEntries + Mutex mMutex; // Guards mThread and mEntries nsCOMPtr mThread; nsTArray mEntries; }; diff --git a/js/src/ds/MemoryProtectionExceptionHandler.cpp b/js/src/ds/MemoryProtectionExceptionHandler.cpp index ef05d7baf817..e4e2332aa449 100644 --- a/js/src/ds/MemoryProtectionExceptionHandler.cpp +++ b/js/src/ds/MemoryProtectionExceptionHandler.cpp @@ -67,7 +67,7 @@ class ProtectedRegionTree { } }; - Mutex lock MOZ_UNANNOTATED; + Mutex lock; LifoAlloc alloc; SplayTree tree; diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index afaa5fab4a48..01d1f949b1ab 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -1246,7 +1246,7 @@ class GCRuntime { /* Synchronize GC heap access among GC helper threads and the main thread. */ friend class js::AutoLockGC; friend class js::AutoLockGCBgAlloc; - js::Mutex lock MOZ_UNANNOTATED; + js::Mutex lock; friend class BackgroundSweepTask; friend class BackgroundFreeTask; diff --git a/js/src/gc/Scheduling.h b/js/src/gc/Scheduling.h index 8040645c0aaf..c9586d243078 100644 --- a/js/src/gc/Scheduling.h +++ b/js/src/gc/Scheduling.h @@ -945,7 +945,7 @@ class MemoryTracker { size_t getAndRemoveEntry(const Key& key, LockGuard& lock); - Mutex mutex MOZ_UNANNOTATED; + Mutex mutex; // Map containing the allocated size associated with (cell, use) pairs. GCMap gcMap; diff --git a/js/src/gc/StoreBuffer.h b/js/src/gc/StoreBuffer.h index e93056b3586e..f1f309eab2cf 100644 --- a/js/src/gc/StoreBuffer.h +++ b/js/src/gc/StoreBuffer.h @@ -441,7 +441,7 @@ class StoreBuffer { } } - Mutex lock_ MOZ_UNANNOTATED; + Mutex lock_; MonoTypeBuffer bufferVal; MonoTypeBuffer bufStrCell; diff --git a/js/src/jit/CacheIRSpewer.h b/js/src/jit/CacheIRSpewer.h index fba33ba990e3..9cf1505450f7 100644 --- a/js/src/jit/CacheIRSpewer.h +++ b/js/src/jit/CacheIRSpewer.h @@ -24,7 +24,7 @@ namespace js { namespace jit { class CacheIRSpewer { - Mutex outputLock_ MOZ_UNANNOTATED; + Mutex outputLock_; Fprinter output_; mozilla::Maybe json_; static CacheIRSpewer cacheIRspewer; diff --git a/js/src/jit/JitSpewer.cpp b/js/src/jit/JitSpewer.cpp index d85fbcf3d39f..6713cafa818f 100644 --- a/js/src/jit/JitSpewer.cpp +++ b/js/src/jit/JitSpewer.cpp @@ -33,7 +33,7 @@ using namespace js::jit; class IonSpewer { private: - Mutex outputLock_ MOZ_UNANNOTATED; + Mutex outputLock_; Fprinter jsonOutput_; bool firstFunction_; bool asyncLogging_; diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp index 5ea4b2e4ca5b..60f60db7bd15 100644 --- a/js/src/jit/ProcessExecutableMemory.cpp +++ b/js/src/jit/ProcessExecutableMemory.cpp @@ -521,7 +521,7 @@ class ProcessExecutableMemory { uint8_t* base_; // The fields below should only be accessed while we hold the lock. - Mutex lock_ MOZ_UNANNOTATED; + Mutex lock_; // pagesAllocated_ is an Atomic so that bytesAllocated does not have to // take the lock. diff --git a/js/src/jit/arm/Simulator-arm.h b/js/src/jit/arm/Simulator-arm.h index fba0f8ce5e00..eb4312e44442 100644 --- a/js/src/jit/arm/Simulator-arm.h +++ b/js/src/jit/arm/Simulator-arm.h @@ -599,7 +599,7 @@ class SimulatorProcess { // This lock creates a critical section around 'redirection_' and // 'icache_', which are referenced both by the execution engine // and by the off-thread compiler (see Redirection::Get in the cpp file). - Mutex cacheLock_ MOZ_UNANNOTATED; + Mutex cacheLock_; Redirection* redirection_; ICacheMap icache_; diff --git a/js/src/jit/arm64/vixl/Simulator-vixl.h b/js/src/jit/arm64/vixl/Simulator-vixl.h index a0515bee062d..f7fd41c569c6 100644 --- a/js/src/jit/arm64/vixl/Simulator-vixl.h +++ b/js/src/jit/arm64/vixl/Simulator-vixl.h @@ -2508,7 +2508,7 @@ class SimulatorProcess {} // Synchronizes access between main thread and compilation threads. - js::Mutex lock_ MOZ_UNANNOTATED; + js::Mutex lock_; vixl::Redirection* redirection_; #ifdef JS_CACHE_SIMULATOR_ARM64 diff --git a/js/src/jit/mips32/Simulator-mips32.h b/js/src/jit/mips32/Simulator-mips32.h index 7ab204af543f..79acef3e6335 100644 --- a/js/src/jit/mips32/Simulator-mips32.h +++ b/js/src/jit/mips32/Simulator-mips32.h @@ -493,7 +493,7 @@ class SimulatorProcess { // This lock creates a critical section around 'redirection_' and // 'icache_', which are referenced both by the execution engine // and by the off-thread compiler (see Redirection::Get in the cpp file). - Mutex cacheLock_ MOZ_UNANNOTATED; + Mutex cacheLock_; Redirection* redirection_; ICacheMap icache_; diff --git a/js/src/jit/mips64/Simulator-mips64.h b/js/src/jit/mips64/Simulator-mips64.h index 02b2774f24de..8f436fb38ad4 100644 --- a/js/src/jit/mips64/Simulator-mips64.h +++ b/js/src/jit/mips64/Simulator-mips64.h @@ -503,7 +503,7 @@ class SimulatorProcess { // This lock creates a critical section around 'redirection_' and // 'icache_', which are referenced both by the execution engine // and by the off-thread compiler (see Redirection::Get in the cpp file). - Mutex cacheLock_ MOZ_UNANNOTATED; + Mutex cacheLock_; Redirection* redirection_; ICacheMap icache_; diff --git a/js/src/jsapi-tests/testCompileNonSyntactic.cpp b/js/src/jsapi-tests/testCompileNonSyntactic.cpp index 34893279e877..c3115e65c5ab 100644 --- a/js/src/jsapi-tests/testCompileNonSyntactic.cpp +++ b/js/src/jsapi-tests/testCompileNonSyntactic.cpp @@ -42,7 +42,7 @@ struct OffThreadTask { self->markDone(token); } - js::Monitor monitor MOZ_UNANNOTATED; + js::Monitor monitor; OffThreadToken* token; }; diff --git a/js/src/jsapi-tests/testScriptSourceCompression.cpp b/js/src/jsapi-tests/testScriptSourceCompression.cpp index 5089930a077a..ea3ce07cc041 100644 --- a/js/src/jsapi-tests/testScriptSourceCompression.cpp +++ b/js/src/jsapi-tests/testScriptSourceCompression.cpp @@ -506,7 +506,7 @@ BEGIN_TEST(testScriptSourceCompression_offThread) { JS::SourceText source; CHECK(source.init(cx, std::move(chars), len)); - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::CompileOptions options(cx); JS::OffThreadToken* token; diff --git a/js/src/jsapi-tests/testStencil.cpp b/js/src/jsapi-tests/testStencil.cpp index 12b6499f4034..32e4d8bf85e9 100644 --- a/js/src/jsapi-tests/testStencil.cpp +++ b/js/src/jsapi-tests/testStencil.cpp @@ -336,7 +336,7 @@ BEGIN_TEST(testStencil_OffThread) { JS::SourceText srcBuf; CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed)); - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::CompileOptions options(cx); JS::OffThreadToken* token; @@ -383,7 +383,7 @@ BEGIN_TEST(testStencil_OffThreadWithInstantiationStorage) { JS::SourceText srcBuf; CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed)); - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::CompileOptions options(cx); JS::OffThreadToken* token; @@ -435,7 +435,7 @@ BEGIN_TEST(testStencil_OffThreadModule) { JS::SourceText srcBuf; CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed)); - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::CompileOptions options(cx); JS::OffThreadToken* token; @@ -487,7 +487,7 @@ BEGIN_TEST(testStencil_OffThreadModuleWithInstantiationStorage) { JS::SourceText srcBuf; CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed)); - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::CompileOptions options(cx); JS::OffThreadToken* token; @@ -571,7 +571,7 @@ BEGIN_TEST(testStencil_OffThreadDecode) { JS::OffThreadToken* token; { JS::DecodeOptions decodeOptions; - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::TranscodeRange range(buffer.begin(), buffer.length()); // Force off-thread even though if this is a small file. @@ -650,7 +650,7 @@ BEGIN_TEST(testStencil_OffThreadDecodeWithInstantiationStorage) { JS::OffThreadToken* token; { JS::DecodeOptions decodeOptions; - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::TranscodeRange range(buffer.begin(), buffer.length()); // Force off-thread even though if this is a small file. @@ -734,7 +734,7 @@ BEGIN_TEST(testStencil_OffThreadDecodeBorrow) { JS::OffThreadToken* token; { JS::DecodeOptions decodeOptions; - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::TranscodeRange range(buffer.begin(), buffer.length()); // Force off-thread even though if this is a small file. @@ -824,7 +824,7 @@ BEGIN_TEST(testStencil_OffThreadDecodePinned) { JS::OffThreadToken* token; { JS::DecodeOptions decodeOptions; - js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState); + js::Monitor monitor(js::mutexid::ShellOffThreadState); JS::TranscodeRange range(pinnedBuffer, pinnedBufferSize); // Force off-thread even though if this is a small file. diff --git a/js/src/jsapi-tests/testThreadingConditionVariable.cpp b/js/src/jsapi-tests/testThreadingConditionVariable.cpp index 1bff19437210..3f934838a633 100644 --- a/js/src/jsapi-tests/testThreadingConditionVariable.cpp +++ b/js/src/jsapi-tests/testThreadingConditionVariable.cpp @@ -11,7 +11,7 @@ #include "vm/MutexIDs.h" struct TestState { - js::Mutex mutex MOZ_UNANNOTATED; + js::Mutex mutex; js::ConditionVariable condition; bool flag; js::Thread testThread; diff --git a/js/src/jsapi-tests/testThreadingMutex.cpp b/js/src/jsapi-tests/testThreadingMutex.cpp index e3d2f1155ded..019f1aaa0e27 100644 --- a/js/src/jsapi-tests/testThreadingMutex.cpp +++ b/js/src/jsapi-tests/testThreadingMutex.cpp @@ -10,7 +10,7 @@ #include "vm/MutexIDs.h" BEGIN_TEST(testThreadingMutex) { - js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex); + js::Mutex mutex(js::mutexid::TestMutex); mutex.lock(); mutex.unlock(); return true; @@ -18,14 +18,14 @@ BEGIN_TEST(testThreadingMutex) { END_TEST(testThreadingMutex) BEGIN_TEST(testThreadingLockGuard) { - js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex); + js::Mutex mutex(js::mutexid::TestMutex); js::LockGuard guard(mutex); return true; } END_TEST(testThreadingLockGuard) BEGIN_TEST(testThreadingUnlockGuard) { - js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex); + js::Mutex mutex(js::mutexid::TestMutex); js::LockGuard guard(mutex); js::UnlockGuard unguard(guard); return true; diff --git a/js/src/shell/jsshell.h b/js/src/shell/jsshell.h index 71d3f5c37d38..12240229de82 100644 --- a/js/src/shell/jsshell.h +++ b/js/src/shell/jsshell.h @@ -229,7 +229,7 @@ struct ShellContext { /* * Watchdog thread state. */ - js::Mutex watchdogLock MOZ_UNANNOTATED; + js::Mutex watchdogLock; js::ConditionVariable watchdogWakeup; mozilla::Maybe watchdogThread; mozilla::Maybe watchdogTimeout; @@ -252,7 +252,7 @@ struct ShellContext { UniquePtr markObservers; // Off-thread parse state. - js::Monitor offThreadMonitor MOZ_UNANNOTATED; + js::Monitor offThreadMonitor; Vector offThreadJobs; // Queued finalization registry cleanup jobs. diff --git a/js/src/threading/ExclusiveData.h b/js/src/threading/ExclusiveData.h index 38e89f10a1d3..586943166799 100644 --- a/js/src/threading/ExclusiveData.h +++ b/js/src/threading/ExclusiveData.h @@ -84,7 +84,7 @@ namespace js { template class ExclusiveData { protected: - mutable Mutex lock_ MOZ_UNANNOTATED; + mutable Mutex lock_; mutable T value_; ExclusiveData(const ExclusiveData&) = delete; @@ -280,7 +280,7 @@ class ExclusiveWaitableData : public ExclusiveData { */ template class RWExclusiveData { - mutable Mutex lock_ MOZ_UNANNOTATED; + mutable Mutex lock_; mutable ConditionVariable cond_; mutable T value_; mutable int readers_; diff --git a/js/src/threading/Thread.h b/js/src/threading/Thread.h index f21b667dff97..4166fbb8b34c 100644 --- a/js/src/threading/Thread.h +++ b/js/src/threading/Thread.h @@ -188,7 +188,7 @@ class ThreadTrampoline { mozilla::Tuple...> args; // Protect the thread id during creation. - Mutex createMutex MOZ_UNANNOTATED; + Mutex createMutex; // Thread can access createMutex. friend class js::Thread; diff --git a/js/src/vm/HelperThreads.h b/js/src/vm/HelperThreads.h index 60fbf70dab2b..cf8fb87aa7c2 100644 --- a/js/src/vm/HelperThreads.h +++ b/js/src/vm/HelperThreads.h @@ -60,7 +60,7 @@ using UniqueTier2GeneratorTask = UniquePtr; * Lock protecting all mutable shared state accessed by helper threads, and used * by all condition variables. */ -extern Mutex gHelperThreadLock MOZ_UNANNOTATED; +extern Mutex gHelperThreadLock; class MOZ_RAII AutoLockHelperThreadState : public LockGuard { using Base = LockGuard; diff --git a/js/src/vm/Monitor.h b/js/src/vm/Monitor.h index 5bc1b141ae7b..9535f7a62958 100644 --- a/js/src/vm/Monitor.h +++ b/js/src/vm/Monitor.h @@ -25,7 +25,7 @@ class Monitor { friend class AutoLockMonitor; friend class AutoUnlockMonitor; - Mutex lock_ MOZ_UNANNOTATED; + Mutex lock_; ConditionVariable condVar_; public: diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index cff07be2a088..16bb7172819e 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -564,7 +564,7 @@ struct JSRuntime { * Locking this only occurs if there is actually a thread other than the * main thread which could access this. */ - js::Mutex scriptDataLock MOZ_UNANNOTATED; + js::Mutex scriptDataLock; #ifdef DEBUG bool activeThreadHasScriptDataAccess; #endif diff --git a/js/src/vm/SharedArrayObject.h b/js/src/vm/SharedArrayObject.h index 353f767ef231..1c190e8554ce 100644 --- a/js/src/vm/SharedArrayObject.h +++ b/js/src/vm/SharedArrayObject.h @@ -50,7 +50,7 @@ class SharedArrayRawBuffer { private: mozilla::Atomic refcount_; mozilla::Atomic length_; - Mutex growLock_ MOZ_UNANNOTATED; + Mutex growLock_; // The index type of this buffer if it is a wasm buffer. wasm::IndexType wasmIndexType_; // The maximum size of this buffer in wasm pages. If this buffer was not diff --git a/js/src/vm/TraceLogging.h b/js/src/vm/TraceLogging.h index 3ca5b5d592a2..31a48d1a462a 100644 --- a/js/src/vm/TraceLogging.h +++ b/js/src/vm/TraceLogging.h @@ -446,7 +446,7 @@ class TraceLoggerThreadState { // Mutex to guard the data structures used to hold the payload data: // textIdPayloads, payloadDictionary & dictionaryData. - Mutex lock MOZ_UNANNOTATED; + Mutex lock; TraceLoggerThreadState() : lock(js::mutexid::TraceLoggerThreadState) {} diff --git a/js/src/vm/TraceLoggingGraph.h b/js/src/vm/TraceLoggingGraph.h index 458ff484e7e3..39ddee03e960 100644 --- a/js/src/vm/TraceLoggingGraph.h +++ b/js/src/vm/TraceLoggingGraph.h @@ -82,7 +82,7 @@ class TraceLoggerGraphState { #endif public: - js::Mutex lock MOZ_UNANNOTATED; + js::Mutex lock; public: TraceLoggerGraphState() diff --git a/js/src/wasm/WasmProcess.cpp b/js/src/wasm/WasmProcess.cpp index 32d84a5919e7..844461010c22 100644 --- a/js/src/wasm/WasmProcess.cpp +++ b/js/src/wasm/WasmProcess.cpp @@ -64,7 +64,7 @@ class ProcessCodeSegmentMap { // Since writes (insertions or removals) can happen on any background // thread at the same time, we need a lock here. - Mutex mutatorsMutex_ MOZ_UNANNOTATED; + Mutex mutatorsMutex_; CodeSegmentVector segments1_; CodeSegmentVector segments2_; diff --git a/js/xpconnect/loader/ScriptPreloader.h b/js/xpconnect/loader/ScriptPreloader.h index c41801953cd0..f443df686324 100644 --- a/js/xpconnect/loader/ScriptPreloader.h +++ b/js/xpconnect/loader/ScriptPreloader.h @@ -530,8 +530,8 @@ class ScriptPreloader : public nsIObserver, // instance. AutoMemMap* mCacheData; - Monitor mMonitor MOZ_UNANNOTATED; - Monitor mSaveMonitor MOZ_UNANNOTATED; + Monitor mMonitor; + Monitor mSaveMonitor; }; } // namespace mozilla diff --git a/js/xpconnect/loader/URLPreloader.h b/js/xpconnect/loader/URLPreloader.h index 54a8eb266ae4..dc9b41f011be 100644 --- a/js/xpconnect/loader/URLPreloader.h +++ b/js/xpconnect/loader/URLPreloader.h @@ -308,7 +308,7 @@ class URLPreloader final : public nsIMemoryReporter { // from the last session's cache file. HashType mCachedURLs; - Monitor mMonitor MOZ_UNANNOTATED{"[URLPreloader::mMutex]"}; + Monitor mMonitor{"[URLPreloader::mMutex]"}; }; } // namespace mozilla diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index b7d5f20688a3..1cfd467a96d0 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -994,7 +994,7 @@ void XPCJSRuntime::OnLargeAllocationFailure() { } class LargeAllocationFailureRunnable final : public Runnable { - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; CondVar mCondVar; bool mWaiting; diff --git a/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp b/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp index cf590b39c467..e954a8b54935 100644 --- a/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp +++ b/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp @@ -106,7 +106,7 @@ class FakeAudioTrack : public ProcessedMediaTrack { uint32_t NumberOfChannels() const override { return NUM_CHANNELS; } private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; MediaTrackListener* mListener = nullptr; nsCOMPtr mTimer; int mCount = 0; diff --git a/memory/build/Mutex.h b/memory/build/Mutex.h index 37c39045ed98..0a1d7631a366 100644 --- a/memory/build/Mutex.h +++ b/memory/build/Mutex.h @@ -122,12 +122,4 @@ struct MOZ_RAII AutoLock { using MutexAutoLock = AutoLock; -// These allow automation to flag added Mutexes/Monitors that haven't been -// annotated. MOZ_UNANNOTATED is applied to legacy instances that haven't -// been annotated yet. MOZ_ANNOTATED is applied to instances we have -// annotated in the (rare) case where there are no GUARDED_BY() annotations -// for the instance. -#define MOZ_UNANNOTATED -#define MOZ_ANNOTATED - #endif diff --git a/memory/build/mozjemalloc.cpp b/memory/build/mozjemalloc.cpp index c20d273da608..bce1b2637e1f 100644 --- a/memory/build/mozjemalloc.cpp +++ b/memory/build/mozjemalloc.cpp @@ -631,7 +631,7 @@ static bool malloc_initialized; static Atomic malloc_initialized; #endif -static StaticMutex gInitLock MOZ_UNANNOTATED = {STATIC_MUTEX_INIT}; +static StaticMutex gInitLock = {STATIC_MUTEX_INIT}; // *************************************************************************** // Statistics data structures. @@ -803,7 +803,7 @@ class AddressRadixTree { static_assert(kBitsAtLevel1 + (kHeight - 1) * kBitsPerLevel == Bits, "AddressRadixTree parameters don't work out"); - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; void** mRoot; public: @@ -979,7 +979,7 @@ struct arena_t { arena_id_t mId; // All operations on this arena require that lock be locked. - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; arena_stats_t mStats; @@ -1204,7 +1204,7 @@ class ArenaCollection { inline arena_t* GetDefault() { return mDefaultArena; } - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; private: inline arena_t* GetByIdInternal(arena_id_t aArenaId, bool aIsPrivate); @@ -1222,7 +1222,7 @@ static ArenaCollection gArenas; static AddressRadixTree<(sizeof(void*) << 3) - LOG2(kChunkSize)> gChunkRTree; // Protects chunk-related data structures. -static Mutex chunks_mtx MOZ_UNANNOTATED; +static Mutex chunks_mtx; // Trees of chunks that were previously allocated (trees differ only in node // ordering). These are used when allocating chunks, in an attempt to re-use @@ -1232,7 +1232,7 @@ static RedBlackTree gChunksBySize; static RedBlackTree gChunksByAddress; // Protects huge allocation-related data structures. -static Mutex huge_mtx MOZ_UNANNOTATED; +static Mutex huge_mtx; // Tree of chunks that are stand-alone huge allocations. static RedBlackTree huge; @@ -1252,7 +1252,7 @@ static void* base_pages; static void* base_next_addr; static void* base_next_decommitted; static void* base_past_addr; // Addr immediately past base_pages. -static Mutex base_mtx MOZ_UNANNOTATED; +static Mutex base_mtx; static size_t base_mapped; static size_t base_committed; diff --git a/memory/replace/logalloc/LogAlloc.cpp b/memory/replace/logalloc/LogAlloc.cpp index 800aefad6a93..8d6aad0675b1 100644 --- a/memory/replace/logalloc/LogAlloc.cpp +++ b/memory/replace/logalloc/LogAlloc.cpp @@ -25,7 +25,7 @@ static malloc_table_t sFuncs; static intptr_t sFd = 0; static bool sStdoutOrStderr = false; -static Mutex sMutex MOZ_UNANNOTATED; +static Mutex sMutex; #ifndef _WIN32 static void prefork() { sMutex.Lock(); } diff --git a/memory/replace/phc/PHC.cpp b/memory/replace/phc/PHC.cpp index 59e5893bb1ab..bec19de51b85 100644 --- a/memory/replace/phc/PHC.cpp +++ b/memory/replace/phc/PHC.cpp @@ -676,7 +676,7 @@ class GMut { public: // The mutex that protects the other members. - static Mutex sMutex MOZ_UNANNOTATED; + static Mutex sMutex; GMut() : mRNG(RandomSeed<0>(), RandomSeed<1>()), diff --git a/memory/volatile/VolatileBuffer.h b/memory/volatile/VolatileBuffer.h index badd7f3cec5e..26c2457e43a0 100644 --- a/memory/volatile/VolatileBuffer.h +++ b/memory/volatile/VolatileBuffer.h @@ -71,7 +71,7 @@ class VolatileBuffer { * buffer. Other member variables are read-only except in Init() and the * destructor. */ - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; void* mBuf; size_t mSize; diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index b871c8e6393f..21a3fc04fcfe 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -683,13 +683,6 @@ * MOZ_LIFETIME_BOUND: Applies to method declarations. * The result of calling these functions on temporaries may not be returned as * a reference or bound to a reference variable. - * MOZ_UNANNOTATED/MOZ_ANNOTATED: Applies to Mutexes/Monitors and variations on - * them. MOZ_UNANNOTATED indicates that the Mutex/Monitor/etc hasn't been - * examined and annotated using macros from mfbt/ThreadSafety -- - * GUARDED_BY()/REQUIRES()/etc. MOZ_ANNOTATED is used in rare cases to indicate - * that is has been looked at, but it did not need any - * GUARDED_BY()/REQUIRES()/etc (and thus static analysis knows it can ignore - * this Mutex/Monitor/etc) */ // gcc emits a nuisance warning -Wignored-attributes because attributes do not @@ -775,13 +768,6 @@ __attribute__((annotate("moz_may_call_after_must_return"))) # define MOZ_LIFETIME_BOUND __attribute__((annotate("moz_lifetime_bound"))) # define MOZ_KNOWN_LIVE __attribute__((annotate("moz_known_live"))) -# ifndef XGILL_PLUGIN -# define MOZ_UNANNOTATED __attribute__((annotate("moz_unannotated"))) -# define MOZ_ANNOTATED __attribute__((annotate("moz_annotated"))) -# else -# define MOZ_UNANNOTATED /* nothing */ -# define MOZ_ANNOTATED /* nothing */ -# endif /* * It turns out that clang doesn't like void func() __attribute__ {} without a @@ -835,8 +821,6 @@ # define MOZ_MAY_CALL_AFTER_MUST_RETURN /* nothing */ # define MOZ_LIFETIME_BOUND /* nothing */ # define MOZ_KNOWN_LIVE /* nothing */ -# define MOZ_UNANNOTATED /* nothing */ -# define MOZ_ANNOTATED /* nothing */ # endif /* defined(MOZ_CLANG_PLUGIN) || defined(XGILL_PLUGIN) */ # define MOZ_RAII MOZ_NON_TEMPORARY_CLASS MOZ_STACK_CLASS diff --git a/modules/libjar/nsJAR.h b/modules/libjar/nsJAR.h index fdca03d474a3..88abf6119ac4 100644 --- a/modules/libjar/nsJAR.h +++ b/modules/libjar/nsJAR.h @@ -164,7 +164,7 @@ class nsZipReaderCache : public nsIZipReaderCache, protected: virtual ~nsZipReaderCache(); - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; uint32_t mCacheSize; ZipsHashtable mZips; diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index 2a751f5af6c8..5557b6233617 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -141,7 +141,7 @@ class ZipArchiveLogger { } private: - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; int mRefCnt; PRFileDesc* mFd; }; diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp index fa88d4b4ec18..6b108298edf5 100644 --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp @@ -3011,7 +3011,7 @@ class PreferencesWriter final { static Atomic sPendingWriteCount; // See PWRunnable::Run for details on why we need this lock. - static StaticMutex sWritingToFile MOZ_UNANNOTATED; + static StaticMutex sWritingToFile; }; Atomic PreferencesWriter::sPendingWriteData(nullptr); @@ -5360,7 +5360,7 @@ static void InitAlwaysPref(const nsCString& aName, T* aCache, } static Atomic sOncePrefRead(false); -static StaticMutex sOncePrefMutex MOZ_UNANNOTATED; +static StaticMutex sOncePrefMutex; namespace StaticPrefs { diff --git a/mozglue/misc/AutoProfilerLabel.cpp b/mozglue/misc/AutoProfilerLabel.cpp index c07ea084dcf6..9bfdc19ef76e 100644 --- a/mozglue/misc/AutoProfilerLabel.cpp +++ b/mozglue/misc/AutoProfilerLabel.cpp @@ -44,7 +44,7 @@ class MOZ_RAII AutoProfilerLabelData { }; // Mutex protecting access to the following static members. - static Mutex sAPLMutex MOZ_UNANNOTATED; + static Mutex sAPLMutex; static ProfilerLabelEnter sEnter; static ProfilerLabelExit sExit; diff --git a/mozglue/misc/PlatformMutex.h b/mozglue/misc/PlatformMutex.h index ac5459cf1033..9792b006ba2b 100644 --- a/mozglue/misc/PlatformMutex.h +++ b/mozglue/misc/PlatformMutex.h @@ -63,4 +63,5 @@ class MutexImpl { } // namespace detail } // namespace mozilla + #endif // mozilla_PlatformMutex_h diff --git a/netwerk/base/AutoClose.h b/netwerk/base/AutoClose.h index a0e3a48e17fd..632b29ed7b54 100644 --- a/netwerk/base/AutoClose.h +++ b/netwerk/base/AutoClose.h @@ -53,7 +53,7 @@ class AutoClose { AutoClose(const AutoClose&) = delete; nsCOMPtr mPtr; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; } // namespace net diff --git a/netwerk/base/BackgroundFileSaver.h b/netwerk/base/BackgroundFileSaver.h index 61e52f8c4977..5edce2e1d65c 100644 --- a/netwerk/base/BackgroundFileSaver.h +++ b/netwerk/base/BackgroundFileSaver.h @@ -117,7 +117,7 @@ class BackgroundFileSaver : public nsIBackgroundFileSaver { * Protects the shared state between control and worker threads. This mutex * is always locked for a very short time, never during input/output. */ - mozilla::Mutex mLock MOZ_UNANNOTATED{"BackgroundFileSaver.mLock"}; + mozilla::Mutex mLock{"BackgroundFileSaver.mLock"}; /** * True if the worker thread is already waiting to process a change in state. diff --git a/netwerk/base/Dashboard.h b/netwerk/base/Dashboard.h index 1112a013e9d8..4179397b0f75 100644 --- a/netwerk/base/Dashboard.h +++ b/netwerk/base/Dashboard.h @@ -61,7 +61,7 @@ class Dashboard final : public nsIDashboard, public nsIDashboardEventNotifier { return data.IndexOf(temp); } nsTArray data; - mozilla::Mutex lock MOZ_UNANNOTATED; + mozilla::Mutex lock; }; bool mEnableLogging; diff --git a/netwerk/base/IOActivityMonitor.h b/netwerk/base/IOActivityMonitor.h index 9a0186c8ada8..998049a9dbc2 100644 --- a/netwerk/base/IOActivityMonitor.h +++ b/netwerk/base/IOActivityMonitor.h @@ -69,7 +69,7 @@ class IOActivityMonitor final : public nsINamed { Activities mActivities; // protects mActivities accesses - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; }; } // namespace net diff --git a/netwerk/base/NetworkConnectivityService.h b/netwerk/base/NetworkConnectivityService.h index d99930933900..e0f6634471b6 100644 --- a/netwerk/base/NetworkConnectivityService.h +++ b/netwerk/base/NetworkConnectivityService.h @@ -65,7 +65,7 @@ class NetworkConnectivityService : public nsINetworkConnectivityService, bool mCheckedNetworkId = false; bool mHasNetworkId = false; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; }; } // namespace net diff --git a/netwerk/base/PartiallySeekableInputStream.h b/netwerk/base/PartiallySeekableInputStream.h index b2cc150fd3e3..92ad4114c522 100644 --- a/netwerk/base/PartiallySeekableInputStream.h +++ b/netwerk/base/PartiallySeekableInputStream.h @@ -82,7 +82,7 @@ class PartiallySeekableInputStream final : public nsISeekableStream, uint64_t mPos; bool mClosed; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; } // namespace net diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp index 8a1e1a3559b6..299e98cba05d 100644 --- a/netwerk/base/ProxyAutoConfig.cpp +++ b/netwerk/base/ProxyAutoConfig.cpp @@ -132,7 +132,7 @@ class PACResolver final : public nsIDNSListener, nsCOMPtr mResponse; nsCOMPtr mTimer; nsCOMPtr mMainThreadEventTarget; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; private: ~PACResolver() = default; diff --git a/netwerk/base/RedirectChannelRegistrar.h b/netwerk/base/RedirectChannelRegistrar.h index 3b8f283ee750..a651e4065068 100644 --- a/netwerk/base/RedirectChannelRegistrar.h +++ b/netwerk/base/RedirectChannelRegistrar.h @@ -39,7 +39,7 @@ class RedirectChannelRegistrar final : public nsIRedirectChannelRegistrar { ChannelHashtable mRealChannels; ParentChannelHashtable mParentChannels; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; static StaticRefPtr gSingleton; }; diff --git a/netwerk/base/SSLTokensCache.h b/netwerk/base/SSLTokensCache.h index 22f622504d60..6a41c39f0ca1 100644 --- a/netwerk/base/SSLTokensCache.h +++ b/netwerk/base/SSLTokensCache.h @@ -63,7 +63,7 @@ class SSLTokensCache : public nsIMemoryReporter { size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; static mozilla::StaticRefPtr gInstance; - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; uint32_t mCacheSize{0}; // Actual cache size in bytes diff --git a/netwerk/base/TLSServerSocket.h b/netwerk/base/TLSServerSocket.h index 36cb292c88a1..be8dd22d3e5d 100644 --- a/netwerk/base/TLSServerSocket.h +++ b/netwerk/base/TLSServerSocket.h @@ -67,7 +67,7 @@ class TLSServerConnectionInfo : public nsITLSServerConnectionInfo, uint32_t mKeyLength{0}; uint32_t mMacLength{0}; // lock protects access to mSecurityObserver - mozilla::Mutex mLock MOZ_UNANNOTATED{"TLSServerConnectionInfo.mLock"}; + mozilla::Mutex mLock{"TLSServerConnectionInfo.mLock"}; nsCOMPtr mSecurityObserver; }; diff --git a/netwerk/base/Tickler.h b/netwerk/base/Tickler.h index 264ecefebb1d..88553732ac79 100644 --- a/netwerk/base/Tickler.h +++ b/netwerk/base/Tickler.h @@ -80,7 +80,7 @@ class Tickler final : public nsSupportsWeakReference { ~Tickler(); friend class TicklerTimer; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; nsCOMPtr mThread; nsCOMPtr mTimer; nsCOMPtr mPrefs; diff --git a/netwerk/base/nsAsyncStreamCopier.h b/netwerk/base/nsAsyncStreamCopier.h index 196e905b40fa..b1ec9b798407 100644 --- a/netwerk/base/nsAsyncStreamCopier.h +++ b/netwerk/base/nsAsyncStreamCopier.h @@ -59,7 +59,7 @@ class nsAsyncStreamCopier final : public nsIAsyncStreamCopier, nsCOMPtr mCopierCtx; - mozilla::Mutex mLock MOZ_UNANNOTATED{"nsAsyncStreamCopier.mLock"}; + mozilla::Mutex mLock{"nsAsyncStreamCopier.mLock"}; nsAsyncCopyMode mMode{NS_ASYNCCOPY_VIA_READSEGMENTS}; uint32_t mChunkSize; diff --git a/netwerk/base/nsBufferedStreams.h b/netwerk/base/nsBufferedStreams.h index 241ca8593a67..95bff7b0b484 100644 --- a/netwerk/base/nsBufferedStreams.h +++ b/netwerk/base/nsBufferedStreams.h @@ -120,7 +120,7 @@ class nsBufferedInputStream final : public nsBufferedStream, NS_IMETHOD Fill() override; NS_IMETHOD Flush() override { return NS_OK; } // no-op for input streams - mozilla::Mutex mMutex MOZ_UNANNOTATED{"nsBufferedInputStream::mMutex"}; + mozilla::Mutex mMutex{"nsBufferedInputStream::mMutex"}; // This value is protected by mutex. nsCOMPtr mAsyncWaitCallback; diff --git a/netwerk/base/nsIOService.h b/netwerk/base/nsIOService.h index ee86f7961160..853218cc30b0 100644 --- a/netwerk/base/nsIOService.h +++ b/netwerk/base/nsIOService.h @@ -232,7 +232,7 @@ class nsIOService final : public nsIIOService, nsCategoryCache mChannelEventSinks{ NS_CHANNEL_EVENT_SINK_CATEGORY}; - Mutex mMutex MOZ_UNANNOTATED{"nsIOService::mMutex"}; + Mutex mMutex{"nsIOService::mMutex"}; nsTArray mRestrictedPortList; uint32_t mTotalRequests{0}; diff --git a/netwerk/base/nsInputStreamPump.h b/netwerk/base/nsInputStreamPump.h index e5571ecdbc3d..c0f6eed9fb7d 100644 --- a/netwerk/base/nsInputStreamPump.h +++ b/netwerk/base/nsInputStreamPump.h @@ -120,7 +120,7 @@ class nsInputStreamPump final : public nsIInputStreamPump, bool mOffMainThread; // If true, OnStateStop() is executed off main thread. Set at creation. // Protects state/member var accesses across multiple threads. - mozilla::RecursiveMutex mMutex MOZ_UNANNOTATED{"nsInputStreamPump"}; + mozilla::RecursiveMutex mMutex{"nsInputStreamPump"}; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsInputStreamPump, NS_INPUT_STREAM_PUMP_IID) diff --git a/netwerk/base/nsMIMEInputStream.cpp b/netwerk/base/nsMIMEInputStream.cpp index b372800e3186..39d084e1f38d 100644 --- a/netwerk/base/nsMIMEInputStream.cpp +++ b/netwerk/base/nsMIMEInputStream.cpp @@ -86,7 +86,7 @@ class nsMIMEInputStream : public nsIMIMEInputStream, nsCOMPtr mStream; bool mStartedReading{false}; - mozilla::Mutex mMutex MOZ_UNANNOTATED{"nsMIMEInputStream::mMutex"}; + mozilla::Mutex mMutex{"nsMIMEInputStream::mMutex"}; // This is protected by mutex. nsCOMPtr mAsyncWaitCallback; diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index c08d33be1f36..56c00d681bce 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -1596,7 +1596,7 @@ class BufferWriter final : public nsIInputStreamCallback { // All the members of this class are touched on the owning thread only. The // monitor is only used to communicate when there is more data to read. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; nsCOMPtr mInputStream; nsCOMPtr mAsyncInputStream; diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp index d81ec1fb797a..2e05157617ce 100644 --- a/netwerk/base/nsProtocolProxyService.cpp +++ b/netwerk/base/nsProtocolProxyService.cpp @@ -1522,7 +1522,7 @@ class nsAsyncBridgeRequest final : public nsPACManCallback { friend class nsProtocolProxyService; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; CondVar mCondVar; nsresult mStatus{NS_OK}; diff --git a/netwerk/base/nsServerSocket.h b/netwerk/base/nsServerSocket.h index fc8390654d78..f22b94e880d0 100644 --- a/netwerk/base/nsServerSocket.h +++ b/netwerk/base/nsServerSocket.h @@ -51,7 +51,7 @@ class nsServerSocket : public nsASocketHandler, public nsIServerSocket { nsresult TryAttach(); // lock protects access to mListener; so it is not cleared while being used. - mozilla::Mutex mLock MOZ_UNANNOTATED{"nsServerSocket.mLock"}; + mozilla::Mutex mLock{"nsServerSocket.mLock"}; PRNetAddr mAddr = {.raw = {0, {0}}}; nsCOMPtr mListenerTarget; bool mAttached{false}; diff --git a/netwerk/base/nsSocketTransport2.h b/netwerk/base/nsSocketTransport2.h index 223d1fd8a1c2..15857d67c78b 100644 --- a/netwerk/base/nsSocketTransport2.h +++ b/netwerk/base/nsSocketTransport2.h @@ -367,7 +367,7 @@ class nsSocketTransport final : public nsASocketHandler, // the exception of some specific methods (XXX). // protects members in this section. - Mutex mLock MOZ_UNANNOTATED{"nsSocketTransport.mLock"}; + Mutex mLock{"nsSocketTransport.mLock"}; LockedPRFileDesc mFD; nsrefcnt mFDref{0}; // mFD is closed when mFDref goes to zero. bool mFDconnected{false}; // mFD is available to consumer when TRUE. diff --git a/netwerk/base/nsSocketTransportService2.h b/netwerk/base/nsSocketTransportService2.h index 451632ac25e7..031810fbb6c6 100644 --- a/netwerk/base/nsSocketTransportService2.h +++ b/netwerk/base/nsSocketTransportService2.h @@ -160,7 +160,7 @@ class nsSocketTransportService final : public nsPISocketTransportService, Atomic mInitialized{false}; // indicates whether we are currently in the process of shutting down Atomic mShuttingDown{false}; - Mutex mLock MOZ_UNANNOTATED{"nsSocketTransportService::mLock"}; + Mutex mLock{"nsSocketTransportService::mLock"}; // Variables in the next section protected by mLock // mThread and mDirectTaskDispatcher are only ever modified on the main diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 36fc56ce65d9..fc70218b048e 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -199,7 +199,7 @@ const nsACString& nsStandardURL::nsSegmentEncoder::EncodeSegment( //---------------------------------------------------------------------------- #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN -static StaticMutex gAllURLsMutex MOZ_UNANNOTATED; +static StaticMutex gAllURLsMutex; static LinkedList gAllURLs; #endif diff --git a/netwerk/base/nsStreamTransportService.cpp b/netwerk/base/nsStreamTransportService.cpp index 79dbb5ba8195..7f9fed292124 100644 --- a/netwerk/base/nsStreamTransportService.cpp +++ b/netwerk/base/nsStreamTransportService.cpp @@ -48,7 +48,7 @@ class nsInputStreamTransport : public nsITransport, private: virtual ~nsInputStreamTransport() = default; - Mutex mMutex MOZ_UNANNOTATED{"nsInputStreamTransport::mMutex"}; + Mutex mMutex{"nsInputStreamTransport::mMutex"}; // This value is protected by mutex. nsCOMPtr mAsyncWaitCallback; diff --git a/netwerk/base/nsStreamTransportService.h b/netwerk/base/nsStreamTransportService.h index d89680803fec..e03615139629 100644 --- a/netwerk/base/nsStreamTransportService.h +++ b/netwerk/base/nsStreamTransportService.h @@ -49,8 +49,7 @@ class nsStreamTransportService final : public nsIStreamTransportService, DataMutex>> mScheduledDelayedRunnables; - mozilla::Mutex mShutdownLock MOZ_UNANNOTATED{ - "nsStreamTransportService.mShutdownLock"}; + mozilla::Mutex mShutdownLock{"nsStreamTransportService.mShutdownLock"}; bool mIsShutdown{false}; }; diff --git a/netwerk/base/nsTransportUtils.cpp b/netwerk/base/nsTransportUtils.cpp index 366aa8cb06f6..4b965a4fdbf4 100644 --- a/netwerk/base/nsTransportUtils.cpp +++ b/netwerk/base/nsTransportUtils.cpp @@ -39,7 +39,7 @@ class nsTransportEventSinkProxy : public nsITransportEventSink { public: nsITransportEventSink* mSink; nsCOMPtr mTarget; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; nsTransportStatusEvent* mLastEvent; }; diff --git a/netwerk/base/nsUDPSocket.h b/netwerk/base/nsUDPSocket.h index 7736d5f995b8..d0114b7197c5 100644 --- a/netwerk/base/nsUDPSocket.h +++ b/netwerk/base/nsUDPSocket.h @@ -59,7 +59,7 @@ class nsUDPSocket final : public nsASocketHandler, public nsIUDPSocket { // lock protects access to mListener; // so mListener is not cleared while being used/locked. - Mutex mLock MOZ_UNANNOTATED{"nsUDPSocket.mLock"}; + Mutex mLock{"nsUDPSocket.mLock"}; PRFileDesc* mFD{nullptr}; NetAddr mAddr; OriginAttributes mOriginAttributes; diff --git a/netwerk/cache/nsCacheUtils.h b/netwerk/cache/nsCacheUtils.h index e9ecb3d6c778..71f3056f89dc 100644 --- a/netwerk/cache/nsCacheUtils.h +++ b/netwerk/cache/nsCacheUtils.h @@ -36,7 +36,7 @@ class nsShutdownThread : public mozilla::Runnable { static nsresult BlockingShutdown(nsIThread* aThread); private: - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; bool mShuttingDown; nsCOMPtr mThread; }; diff --git a/netwerk/cache2/CacheEntry.h b/netwerk/cache2/CacheEntry.h index e859f3f3e8f0..e549564dac71 100644 --- a/netwerk/cache2/CacheEntry.h +++ b/netwerk/cache2/CacheEntry.h @@ -310,7 +310,7 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener { bool aMemoryOnly, nsICacheEntryOpenCallback* aCallback); void TransferCallbacks(CacheEntry& aFromEntry); - mozilla::Mutex mLock MOZ_UNANNOTATED{"CacheEntry"}; + mozilla::Mutex mLock{"CacheEntry"}; // Reflects the number of existing handles for this entry ::mozilla::ThreadSafeAutoRefCnt mHandlesCount; diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index 06ca89e67157..516ce694f84d 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -564,7 +564,7 @@ class ShutdownEvent : public Runnable { } protected: - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; bool mNotified{false}; }; @@ -4197,7 +4197,7 @@ class SizeOfHandlesRunnable : public Runnable { } private: - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; bool mMonitorNotified; mozilla::MallocSizeOf mMallocSizeOf; CacheFileHandles const& mHandles; diff --git a/netwerk/cache2/CacheFileUtils.h b/netwerk/cache2/CacheFileUtils.h index 5e4a97d9cba7..0fc5dd7d2d4e 100644 --- a/netwerk/cache2/CacheFileUtils.h +++ b/netwerk/cache2/CacheFileUtils.h @@ -131,7 +131,7 @@ class DetailedCacheHitTelemetry { static const uint32_t kHitRateBuckets = 20; // Protects sRecordCnt, sHitStats and Telemetry::Accumulated() calls. - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; // Counter of samples that is compared against kTotalSamplesReportLimit. static uint32_t sRecordCnt; @@ -203,7 +203,7 @@ class CachePerfStats { MMA mShortAvg; }; - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; static PerfData sData[LAST]; static uint32_t sCacheSlowCnt; @@ -228,7 +228,7 @@ class CacheFileLock final { private: ~CacheFileLock() = default; - mozilla::Mutex mLock MOZ_UNANNOTATED{"CacheFile.mLock"}; + mozilla::Mutex mLock{"CacheFile.mLock"}; }; } // namespace CacheFileUtils diff --git a/netwerk/cache2/CacheIOThread.h b/netwerk/cache2/CacheIOThread.h index 3790baf4aed4..15bca35016b2 100644 --- a/netwerk/cache2/CacheIOThread.h +++ b/netwerk/cache2/CacheIOThread.h @@ -111,7 +111,7 @@ class CacheIOThread final : public nsIThreadObserver { static CacheIOThread* sSelf; - mozilla::Monitor mMonitor MOZ_UNANNOTATED{"CacheIOThread"}; + mozilla::Monitor mMonitor{"CacheIOThread"}; PRThread* mThread{nullptr}; // Only set in Init(), before the thread is started, which reads it but never // writes diff --git a/netwerk/cache2/CacheIndex.h b/netwerk/cache2/CacheIndex.h index 684db9f96c15..7adb31460749 100644 --- a/netwerk/cache2/CacheIndex.h +++ b/netwerk/cache2/CacheIndex.h @@ -1050,7 +1050,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable { void DoTelemetryReport(); static mozilla::StaticRefPtr gInstance; - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; nsCOMPtr mCacheDirectory; diff --git a/netwerk/cache2/CacheStorageService.h b/netwerk/cache2/CacheStorageService.h index 3781d512e59f..9e09eabe81a5 100644 --- a/netwerk/cache2/CacheStorageService.h +++ b/netwerk/cache2/CacheStorageService.h @@ -324,7 +324,7 @@ class CacheStorageService final : public nsICacheStorageService, static CacheStorageService* sSelf; - mozilla::Mutex mLock MOZ_UNANNOTATED{"CacheStorageService.mLock"}; + mozilla::Mutex mLock{"CacheStorageService.mLock"}; mozilla::Mutex mForcedValidEntriesLock{ "CacheStorageService.mForcedValidEntriesLock"}; @@ -413,7 +413,7 @@ class CacheStorageService final : public nsICacheStorageService, virtual ~IOThreadSuspender() = default; NS_IMETHOD Run() override; - Monitor mMon MOZ_UNANNOTATED; + Monitor mMon; bool mSignaled{false}; }; diff --git a/netwerk/cookie/CookiePersistentStorage.h b/netwerk/cookie/CookiePersistentStorage.h index 063b5bd86739..40c969f2a70f 100644 --- a/netwerk/cookie/CookiePersistentStorage.h +++ b/netwerk/cookie/CookiePersistentStorage.h @@ -128,7 +128,7 @@ class CookiePersistentStorage final : public CookieStorage { TimeStamp mEndInitDBConn; nsTArray mReadArray; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; Atomic mInitialized; Atomic mInitializedDBConn; diff --git a/netwerk/dns/ChildDNSService.h b/netwerk/dns/ChildDNSService.h index b9e672d4a096..395058bc3b8e 100644 --- a/netwerk/dns/ChildDNSService.h +++ b/netwerk/dns/ChildDNSService.h @@ -58,7 +58,7 @@ class ChildDNSService final : public DNSServiceBase, public nsPIDNSService { // We need to remember pending dns requests to be able to cancel them. nsClassHashtable>> mPendingRequests; - Mutex mPendingRequestsLock MOZ_UNANNOTATED{"DNSPendingRequestsLock"}; + Mutex mPendingRequestsLock{"DNSPendingRequestsLock"}; RefPtr mTRRServiceParent; }; diff --git a/netwerk/dns/GetAddrInfo.h b/netwerk/dns/GetAddrInfo.h index 13bc2412d28c..e2c01e0fd240 100644 --- a/netwerk/dns/GetAddrInfo.h +++ b/netwerk/dns/GetAddrInfo.h @@ -73,7 +73,7 @@ class NativeDNSResolverOverride : public nsINativeDNSResolverOverride { private: virtual ~NativeDNSResolverOverride() = default; - mozilla::RWLock mLock MOZ_UNANNOTATED{"NativeDNSResolverOverride"}; + mozilla::RWLock mLock{"NativeDNSResolverOverride"}; nsTHashMap> mOverrides; nsTHashMap mCnames; diff --git a/netwerk/dns/ODoHService.h b/netwerk/dns/ODoHService.h index 75f06789a87a..3e80fbc2e7fd 100644 --- a/netwerk/dns/ODoHService.h +++ b/netwerk/dns/ODoHService.h @@ -58,7 +58,7 @@ class ODoHService : public nsIDNSListener, nsresult UpdateODoHConfigFromHTTPSRR(); nsresult UpdateODoHConfigFromURI(); - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; Atomic mQueryODoHConfigInProgress; nsCString mODoHProxyURI; nsCString mODoHTargetHost; diff --git a/netwerk/dns/TRRQuery.h b/netwerk/dns/TRRQuery.h index e53a0459a373..8975a2639860 100644 --- a/netwerk/dns/TRRQuery.h +++ b/netwerk/dns/TRRQuery.h @@ -83,8 +83,7 @@ class TRRQuery : public AHostResolver { RefPtr mHostResolver; RefPtr mRecord; - Mutex mTrrLock - MOZ_UNANNOTATED; // lock when accessing the mTrrA[AAA] pointers + Mutex mTrrLock; // lock when accessing the mTrrA[AAA] pointers RefPtr mTrrA; RefPtr mTrrAAAA; RefPtr mTrrByType; diff --git a/netwerk/dns/TRRService.h b/netwerk/dns/TRRService.h index 4fb54bdc4ec8..47fd64956a1a 100644 --- a/netwerk/dns/TRRService.h +++ b/netwerk/dns/TRRService.h @@ -119,7 +119,7 @@ class TRRService : public TRRServiceBase, void AddEtcHosts(const nsTArray&); bool mInitialized{false}; - Mutex mLock MOZ_UNANNOTATED{"TRRService"}; + Mutex mLock{"TRRService"}; nsCString mPrivateCred; // main thread only nsCString mConfirmationNS{"example.com"_ns}; diff --git a/netwerk/dns/nsDNSService2.h b/netwerk/dns/nsDNSService2.h index 791feed0ccd1..09a357203c8f 100644 --- a/netwerk/dns/nsDNSService2.h +++ b/netwerk/dns/nsDNSService2.h @@ -106,7 +106,7 @@ class nsDNSService final : public mozilla::net::DNSServiceBase, // mLock protects access to mResolver, mLocalDomains, mIPv4OnlyDomains and // mFailedSVCDomainNames - mozilla::Mutex mLock MOZ_UNANNOTATED{"nsDNSServer.mLock"}; + mozilla::Mutex mLock{"nsDNSServer.mLock"}; // mIPv4OnlyDomains is a comma-separated list of domains for which only // IPv4 DNS lookups are performed. This allows the user to disable IPv6 on diff --git a/netwerk/dns/nsEffectiveTLDService.h b/netwerk/dns/nsEffectiveTLDService.h index 53772b956cad..9a9ad22977f9 100644 --- a/netwerk/dns/nsEffectiveTLDService.h +++ b/netwerk/dns/nsEffectiveTLDService.h @@ -56,7 +56,7 @@ class nsEffectiveTLDService final : public nsIEffectiveTLDService, mozilla::loader::AutoMemMap mDafsaMap; // Lock for mGraph and mDafsaMap - mozilla::RWLock mGraphLock MOZ_UNANNOTATED; + mozilla::RWLock mGraphLock; // Note that the cache entries here can record entries that were cached // successfully or unsuccessfully. mResult must be checked before using an diff --git a/netwerk/dns/nsHostRecord.h b/netwerk/dns/nsHostRecord.h index aa8df94df325..c3a44c0415c9 100644 --- a/netwerk/dns/nsHostRecord.h +++ b/netwerk/dns/nsHostRecord.h @@ -241,7 +241,7 @@ class AddrHostRecord final : public nsHostRecord { * the other threads just read it. therefore the resolver worker * thread doesn't need to lock when reading |addr_info|. */ - Mutex addr_info_lock MOZ_UNANNOTATED{"AddrHostRecord.addr_info_lock"}; + Mutex addr_info_lock{"AddrHostRecord.addr_info_lock"}; // generation count of |addr_info| int addr_info_gencnt = 0; RefPtr addr_info; @@ -355,7 +355,7 @@ class TypeHostRecord final : public nsHostRecord, bool RefreshForNegativeResponse() const override; mozilla::net::TypeRecordResultType mResults = AsVariant(mozilla::Nothing()); - mozilla::Mutex mResultsLock MOZ_UNANNOTATED{"TypeHostRecord.mResultsLock"}; + mozilla::Mutex mResultsLock{"TypeHostRecord.mResultsLock"}; // When the lookups of this record started (for telemetry). mozilla::TimeStamp mStart; diff --git a/netwerk/dns/nsHostResolver.h b/netwerk/dns/nsHostResolver.h index 63b74e67eee5..eeb604255caa 100644 --- a/netwerk/dns/nsHostResolver.h +++ b/netwerk/dns/nsHostResolver.h @@ -292,7 +292,7 @@ class nsHostResolver : public nsISupports, public AHostResolver { uint32_t mDefaultCacheLifetime = 0; // granularity seconds uint32_t mDefaultGracePeriod = 0; // granularity seconds // mutable so SizeOfIncludingThis can be const - mutable Mutex mLock MOZ_UNANNOTATED{"nsHostResolver.mLock"}; + mutable Mutex mLock{"nsHostResolver.mLock"}; CondVar mIdleTaskCV; nsRefPtrHashtable, nsHostRecord> mRecordDB; PRTime mCreationTime; diff --git a/netwerk/dns/nsIDNService.h b/netwerk/dns/nsIDNService.h index 7816cb6b47c8..bb23e7f0a24b 100644 --- a/netwerk/dns/nsIDNService.h +++ b/netwerk/dns/nsIDNService.h @@ -170,7 +170,7 @@ class nsIDNService final : public nsIIDNService, // These members can only be updated on the main thread and // read on any thread. Therefore, acquiring the mutex is required // only for threads other than the main thread. - mozilla::Mutex mLock MOZ_UNANNOTATED{"IDNService"}; + mozilla::Mutex mLock{"IDNService"}; // guarded by mLock nsTArray mIDNBlocklist; diff --git a/netwerk/ipc/ChannelEventQueue.h b/netwerk/ipc/ChannelEventQueue.h index e9db71ea7f87..1f26adaa90be 100644 --- a/netwerk/ipc/ChannelEventQueue.h +++ b/netwerk/ipc/ChannelEventQueue.h @@ -190,10 +190,10 @@ class ChannelEventQueue final { nsISupports* mOwner; // For atomic mEventQueue operation and state update - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // To guarantee event execution order among threads - RecursiveMutex mRunningMutex MOZ_UNANNOTATED; + RecursiveMutex mRunningMutex; friend class AutoEventEnqueuer; }; diff --git a/netwerk/ipc/SocketProcessChild.h b/netwerk/ipc/SocketProcessChild.h index baa4566c46ee..f8e1b82aeb1a 100644 --- a/netwerk/ipc/SocketProcessChild.h +++ b/netwerk/ipc/SocketProcessChild.h @@ -177,7 +177,7 @@ class SocketProcessChild final bool mShuttingDown{false}; // Protect the table below. - Mutex mMutex MOZ_UNANNOTATED{"SocketProcessChild::mMutex"}; + Mutex mMutex{"SocketProcessChild::mMutex"}; nsTHashMap> mBackgroundDataBridgeMap; }; diff --git a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp index 66cc8ea8cf60..ac4b18ea191a 100644 --- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp +++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp @@ -205,8 +205,7 @@ class nsGIOInputStream final : public nsIInputStream { bool mDirOpen{false}; MountOperationResult mMountRes = MountOperationResult::MOUNT_OPERATION_SUCCESS; - mozilla::Monitor mMonitorMountInProgress MOZ_UNANNOTATED{ - "GIOInputStream::MountFinished"}; + mozilla::Monitor mMonitorMountInProgress{"GIOInputStream::MountFinished"}; gint mMountErrorCode{}; }; diff --git a/netwerk/protocol/http/HttpBackgroundChannelParent.h b/netwerk/protocol/http/HttpBackgroundChannelParent.h index 0d886db699d4..66b708cac134 100644 --- a/netwerk/protocol/http/HttpBackgroundChannelParent.h +++ b/netwerk/protocol/http/HttpBackgroundChannelParent.h @@ -108,7 +108,7 @@ class HttpBackgroundChannelParent final : public PHttpBackgroundChannelParent { Atomic mIPCOpened; // Used to ensure atomicity of mBackgroundThread - Mutex mBgThreadMutex MOZ_UNANNOTATED; + Mutex mBgThreadMutex; nsCOMPtr mBackgroundThread; diff --git a/netwerk/protocol/http/HttpChannelChild.h b/netwerk/protocol/http/HttpChannelChild.h index 96c8077e21f2..0b21e7bc98ac 100644 --- a/netwerk/protocol/http/HttpChannelChild.h +++ b/netwerk/protocol/http/HttpChannelChild.h @@ -274,7 +274,7 @@ class HttpChannelChild final : public PHttpChannelChild, nsCOMPtr mAltDataInputStream; // Used to ensure atomicity of mBgChild and mBgInitFailCallback - Mutex mBgChildMutex MOZ_UNANNOTATED{"HttpChannelChild::BgChildMutex"}; + Mutex mBgChildMutex{"HttpChannelChild::BgChildMutex"}; // Associated HTTP background channel RefPtr mBgChild; @@ -289,7 +289,7 @@ class HttpChannelChild final : public PHttpChannelChild, // Target thread for delivering ODA. nsCOMPtr mODATarget; // Used to ensure atomicity of mNeckoTarget / mODATarget; - Mutex mEventTargetMutex MOZ_UNANNOTATED{"HttpChannelChild::EventTargetMutex"}; + Mutex mEventTargetMutex{"HttpChannelChild::EventTargetMutex"}; TimeStamp mLastStatusReported; diff --git a/netwerk/protocol/http/HttpConnectionBase.h b/netwerk/protocol/http/HttpConnectionBase.h index c28f01fb330d..ffb895e99c92 100644 --- a/netwerk/protocol/http/HttpConnectionBase.h +++ b/netwerk/protocol/http/HttpConnectionBase.h @@ -148,7 +148,7 @@ class HttpConnectionBase : public nsSupportsWeakReference { bool mBootstrappedTimingsSet{false}; TimingStruct mBootstrappedTimings; - Mutex mCallbacksLock MOZ_UNANNOTATED{"nsHttpConnection::mCallbacksLock"}; + Mutex mCallbacksLock{"nsHttpConnection::mCallbacksLock"}; nsMainThreadPtrHandle mCallbacks; nsTArray mTrafficCategory; diff --git a/netwerk/protocol/http/HttpConnectionMgrParent.h b/netwerk/protocol/http/HttpConnectionMgrParent.h index c9a3653a2ab9..716a7d7bd217 100644 --- a/netwerk/protocol/http/HttpConnectionMgrParent.h +++ b/netwerk/protocol/http/HttpConnectionMgrParent.h @@ -34,7 +34,7 @@ class HttpConnectionMgrParent final : public PHttpConnectionMgrParent, bool mShutDown{false}; static uint32_t sListenerId; - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; static nsTHashMap> sHttpUpgradeListenerMap; }; diff --git a/netwerk/protocol/http/HttpTransactionParent.h b/netwerk/protocol/http/HttpTransactionParent.h index 77cd2ec70a1f..d29b25b8e9db 100644 --- a/netwerk/protocol/http/HttpTransactionParent.h +++ b/netwerk/protocol/http/HttpTransactionParent.h @@ -119,8 +119,7 @@ class HttpTransactionParent final : public PHttpTransactionParent, nsCOMPtr mChannel; nsCOMPtr mTargetThread; nsCOMPtr mODATarget; - Mutex mEventTargetMutex MOZ_UNANNOTATED{ - "HttpTransactionParent::EventTargetMutex"}; + Mutex mEventTargetMutex{"HttpTransactionParent::EventTargetMutex"}; nsCOMPtr mSecurityInfo; UniquePtr mResponseHead; UniquePtr mResponseTrailers; diff --git a/netwerk/protocol/http/nsCORSListenerProxy.h b/netwerk/protocol/http/nsCORSListenerProxy.h index 6d158252e2e6..a4d70e3c249a 100644 --- a/netwerk/protocol/http/nsCORSListenerProxy.h +++ b/netwerk/protocol/http/nsCORSListenerProxy.h @@ -123,7 +123,7 @@ class nsCORSListenerProxy final : public nsIStreamListener, // only locking mOuterListener, because it can be used on different threads. // We guarantee that OnStartRequest, OnDataAvailable and OnStopReques will be // called in order, but to make tsan happy we will lock mOuterListener. - mutable mozilla::Mutex mMutex MOZ_UNANNOTATED; + mutable mozilla::Mutex mMutex; }; #endif diff --git a/netwerk/protocol/http/nsHttpActivityDistributor.h b/netwerk/protocol/http/nsHttpActivityDistributor.h index b2d9ee20a45b..5d9524680aa5 100644 --- a/netwerk/protocol/http/nsHttpActivityDistributor.h +++ b/netwerk/protocol/http/nsHttpActivityDistributor.h @@ -28,7 +28,7 @@ class nsHttpActivityDistributor : public nsIHttpActivityDistributor { virtual ~nsHttpActivityDistributor() = default; ObserverArray mObservers; - Mutex mLock MOZ_UNANNOTATED{"nsHttpActivityDistributor.mLock"}; + Mutex mLock{"nsHttpActivityDistributor.mLock"}; Atomic mActivated{false}; Atomic mObserveProxyResponse{false}; Atomic mObserveConnection{false}; diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h index c4d7850fd741..7871be7858fd 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h @@ -797,7 +797,7 @@ class nsHttpChannel final : public HttpBaseChannel, bool mIgnoreCacheEntry{false}; // Lock preventing SetupTransaction/MaybeCreateCacheEntryWhenRCWN and // OnCacheEntryCheck being called at the same time. - mozilla::Mutex mRCWNLock MOZ_UNANNOTATED{"nsHttpChannel.mRCWNLock"}; + mozilla::Mutex mRCWNLock{"nsHttpChannel.mRCWNLock"}; TimeStamp mNavigationStartTimeStamp; diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.h b/netwerk/protocol/http/nsHttpConnectionMgr.h index 5bdc4f065eb2..7d2a5bde7a26 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.h +++ b/netwerk/protocol/http/nsHttpConnectionMgr.h @@ -207,8 +207,7 @@ class nsHttpConnectionMgr final : public HttpConnectionMgrShell, // NOTE: these members may be accessed from any thread (use mReentrantMonitor) //------------------------------------------------------------------------- - ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED{ - "nsHttpConnectionMgr.mReentrantMonitor"}; + ReentrantMonitor mReentrantMonitor{"nsHttpConnectionMgr.mReentrantMonitor"}; // This is used as a flag that we're shut down, and no new events should be // dispatched. nsCOMPtr mSocketThreadTarget; diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h index becbae946877..4e1e1145c443 100644 --- a/netwerk/protocol/http/nsHttpHandler.h +++ b/netwerk/protocol/http/nsHttpHandler.h @@ -804,7 +804,7 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, "nsHttpConnectionMgr::LastActiveTabLoadOptimization"}; TimeStamp mLastActiveTabLoadOptimizationHit; - Mutex mHttpExclusionLock MOZ_UNANNOTATED{"nsHttpHandler::HttpExclusion"}; + Mutex mHttpExclusionLock{"nsHttpHandler::HttpExclusion"}; public: [[nodiscard]] nsresult NewChannelId(uint64_t& channelId); diff --git a/netwerk/protocol/http/nsHttpRequestHead.h b/netwerk/protocol/http/nsHttpRequestHead.h index 3d8dc2f88b97..4984edd2197e 100644 --- a/netwerk/protocol/http/nsHttpRequestHead.h +++ b/netwerk/protocol/http/nsHttpRequestHead.h @@ -134,8 +134,7 @@ class nsHttpRequestHead { // We are using RecursiveMutex instead of a Mutex because VisitHeader // function calls nsIHttpHeaderVisitor::VisitHeader while under lock. - mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED{ - "nsHttpRequestHead.mRecursiveMutex"}; + mutable RecursiveMutex mRecursiveMutex{"nsHttpRequestHead.mRecursiveMutex"}; // During VisitHeader we sould not allow cal to SetHeader. bool mInVisitHeaders{false}; diff --git a/netwerk/protocol/http/nsHttpResponseHead.h b/netwerk/protocol/http/nsHttpResponseHead.h index 8dab39ecdacc..7970dd3a6e6f 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.h +++ b/netwerk/protocol/http/nsHttpResponseHead.h @@ -207,8 +207,7 @@ class nsHttpResponseHead { // We are using RecursiveMutex instead of a Mutex because VisitHeader // function calls nsIHttpHeaderVisitor::VisitHeader while under lock. - mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED{ - "nsHttpResponseHead.mRecursiveMutex"}; + mutable RecursiveMutex mRecursiveMutex{"nsHttpResponseHead.mRecursiveMutex"}; // During VisitHeader we sould not allow cal to SetHeader. bool mInVisitHeaders{false}; diff --git a/netwerk/protocol/http/nsHttpTransaction.h b/netwerk/protocol/http/nsHttpTransaction.h index 6b95e9075f54..5c5fae13ce0b 100644 --- a/netwerk/protocol/http/nsHttpTransaction.h +++ b/netwerk/protocol/http/nsHttpTransaction.h @@ -300,7 +300,7 @@ class nsHttpTransaction final : public nsAHttpTransaction, nsCOMPtr mCallbacks; }; - Mutex mLock MOZ_UNANNOTATED{"transaction lock"}; + Mutex mLock{"transaction lock"}; nsCOMPtr mCallbacks; nsCOMPtr mTransportSink; diff --git a/netwerk/protocol/res/SubstitutingProtocolHandler.h b/netwerk/protocol/res/SubstitutingProtocolHandler.h index 9b98954a641c..3dab910de598 100644 --- a/netwerk/protocol/res/SubstitutingProtocolHandler.h +++ b/netwerk/protocol/res/SubstitutingProtocolHandler.h @@ -103,7 +103,7 @@ class SubstitutingProtocolHandler { nsCString mScheme; Maybe mFlags; - RWLock mSubstitutionsLock MOZ_UNANNOTATED; + RWLock mSubstitutionsLock; nsTHashMap mSubstitutions; nsCOMPtr mIOService; diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 6858219fb7d7..3dd0a3ed9f4b 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -554,7 +554,7 @@ class nsWSAdmissionManager { FailDelayManager mFailures; static nsWSAdmissionManager* sManager; - static StaticMutex sLock MOZ_UNANNOTATED; + static StaticMutex sLock; }; nsWSAdmissionManager* nsWSAdmissionManager::sManager; diff --git a/netwerk/protocol/websocket/WebSocketChannel.h b/netwerk/protocol/websocket/WebSocketChannel.h index a9fb6a0f6aed..6604102a2ba0 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.h +++ b/netwerk/protocol/websocket/WebSocketChannel.h @@ -357,7 +357,7 @@ class WebSocketChannel : public BaseWebSocketChannel, nsCOMPtr mConnectionLogService; // effectively const - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; }; class WebSocketSSLChannel : public WebSocketChannel { diff --git a/netwerk/protocol/websocket/WebSocketChannelChild.h b/netwerk/protocol/websocket/WebSocketChannelChild.h index 0c537c09fb0f..25911a45b554 100644 --- a/netwerk/protocol/websocket/WebSocketChannelChild.h +++ b/netwerk/protocol/websocket/WebSocketChannelChild.h @@ -98,7 +98,7 @@ class WebSocketChannelChild final : public BaseWebSocketChannel, // This variable is protected by mutex. enum { Opened, Closing, Closed } mIPCState; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; friend class StartEvent; friend class StopEvent; diff --git a/netwerk/protocol/websocket/WebSocketConnectionParent.h b/netwerk/protocol/websocket/WebSocketConnectionParent.h index f850abf04a5f..1b6dc231f1d6 100644 --- a/netwerk/protocol/websocket/WebSocketConnectionParent.h +++ b/netwerk/protocol/websocket/WebSocketConnectionParent.h @@ -59,7 +59,7 @@ class WebSocketConnectionParent final : public PWebSocketConnectionParent, nsCOMPtr mBackgroundThread; nsCOMPtr mSecurityInfo; Atomic mClosed{false}; - Mutex mMutex MOZ_UNANNOTATED{"WebSocketConnectionParent::mMutex"}; + Mutex mMutex{"WebSocketConnectionParent::mMutex"}; }; } // namespace net diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index a628c2ba6ef8..5747f9bc494c 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -242,7 +242,7 @@ class DataChannelRegistry { uintptr_t mNextId = 1; std::map> mConnections; UniquePtr mShutdownBlocker; - static StaticMutex sInstanceMutex MOZ_UNANNOTATED; + static StaticMutex sInstanceMutex; }; StaticMutex DataChannelRegistry::sInstanceMutex; diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h index 76c865eeb2c1..438d89d43d66 100644 --- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -211,7 +211,7 @@ class DataChannelConnection final : public net::NeckoTargetHolder // Find out state enum { CONNECTING = 0U, OPEN = 1U, CLOSING = 2U, CLOSED = 3U }; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; void ReadBlob(already_AddRefed aThis, uint16_t aStream, nsIInputStream* aBlob); @@ -349,7 +349,7 @@ class DataChannelConnection final : public net::NeckoTargetHolder bool LessThan(const RefPtr& a1, const RefPtr& a2) const; }; - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; ChannelArray mChannels; }; @@ -563,7 +563,7 @@ class DataChannel { nsTArray> mBufferedData; // GUARDED_BY(mConnection->mLock) nsCOMPtr mMainThreadEventTarget; - mutable Mutex mStatsLock MOZ_UNANNOTATED; // protects mTrafficCounters + mutable Mutex mStatsLock; // protects mTrafficCounters TrafficCounters mTrafficCounters; }; diff --git a/netwerk/socket/nsNamedPipeService.h b/netwerk/socket/nsNamedPipeService.h index cbe6ff9631e9..5d6e5f86fe4e 100644 --- a/netwerk/socket/nsNamedPipeService.h +++ b/netwerk/socket/nsNamedPipeService.h @@ -51,7 +51,7 @@ class NamedPipeService final : public nsINamedPipeService, * the worker thread to avoid a race condition that might happen between * |CloseHandle()| and |GetQueuedCompletionStatus()|. */ - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; nsTArray> mObservers; // protected by mLock nsTArray> diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.h b/netwerk/streamconv/converters/nsHTTPCompressConv.h index c21cb3ebde52..9c3742733a16 100644 --- a/netwerk/streamconv/converters/nsHTTPCompressConv.h +++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h @@ -101,7 +101,7 @@ class nsHTTPCompressConv : public nsIStreamConverter, Atomic mDecodedDataLength{0}; - mutable mozilla::Mutex mMutex MOZ_UNANNOTATED{"nsHTTPCompressConv"}; + mutable mozilla::Mutex mMutex{"nsHTTPCompressConv"}; }; } // namespace net diff --git a/netwerk/streamconv/converters/nsUnknownDecoder.h b/netwerk/streamconv/converters/nsUnknownDecoder.h index 70cd72dbc5f9..45dd6bae25b2 100644 --- a/netwerk/streamconv/converters/nsUnknownDecoder.h +++ b/netwerk/streamconv/converters/nsUnknownDecoder.h @@ -131,7 +131,7 @@ class nsUnknownDecoder : public nsIStreamConverter, nsCString mContentType; // This mutex syncs: mContentType, mDecodedData and mNextListener. - mutable mozilla::Mutex mMutex MOZ_UNANNOTATED; + mutable mozilla::Mutex mMutex; protected: nsresult ConvertEncodedData(nsIRequest* request, const char* data, diff --git a/netwerk/system/mac/nsNetworkLinkService.h b/netwerk/system/mac/nsNetworkLinkService.h index aa74d4b4b8c7..c236cfdd5651 100644 --- a/netwerk/system/mac/nsNetworkLinkService.h +++ b/netwerk/system/mac/nsNetworkLinkService.h @@ -69,7 +69,7 @@ class nsNetworkLinkService : public nsINetworkLinkService, bool RoutingFromKernel(nsTArray& aHash); bool RoutingTable(nsTArray& aHash); - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; nsCString mNetworkId; nsTArray mDNSSuffixList; diff --git a/netwerk/system/netlink/NetlinkService.h b/netwerk/system/netlink/NetlinkService.h index 0c3b0ca88254..0734e4440c63 100644 --- a/netwerk/system/netlink/NetlinkService.h +++ b/netwerk/system/netlink/NetlinkService.h @@ -62,7 +62,7 @@ class NetlinkService : public nsIRunnable { void EnqueueRtMsg(uint8_t aFamily, void* aAddress); void RemovePendingMsg(); - mozilla::Mutex mMutex MOZ_UNANNOTATED{"NetlinkService::mMutex"}; + mozilla::Mutex mMutex{"NetlinkService::mMutex"}; void OnNetlinkMessage(int aNetlinkSocket); void OnLinkMessage(struct nlmsghdr* aNlh); diff --git a/netwerk/system/win32/nsNotifyAddrListener.h b/netwerk/system/win32/nsNotifyAddrListener.h index 30244685f282..3406dd3b94ac 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.h +++ b/netwerk/system/win32/nsNotifyAddrListener.h @@ -68,7 +68,7 @@ class nsNotifyAddrListener : public nsINetworkLinkService, void calculateNetworkId(void); bool findMac(char* gateway); - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; nsCString mNetworkId; nsTArray mDnsSuffixList; nsTArray mDNSResolvers; diff --git a/netwerk/test/gtest/TestNamedPipeService.cpp b/netwerk/test/gtest/TestNamedPipeService.cpp index 8daa9247e653..c26424e46c42 100644 --- a/netwerk/test/gtest/TestNamedPipeService.cpp +++ b/netwerk/test/gtest/TestNamedPipeService.cpp @@ -43,7 +43,7 @@ class Event { } private: - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; bool mSignaled = false; }; diff --git a/netwerk/wifi/nsWifiMonitor.h b/netwerk/wifi/nsWifiMonitor.h index 62099190b29e..645600af336a 100644 --- a/netwerk/wifi/nsWifiMonitor.h +++ b/netwerk/wifi/nsWifiMonitor.h @@ -65,7 +65,7 @@ class nsWifiMonitor final : nsIRunnable, nsIWifiMonitor, nsIObserver { nsTArray mListeners; - mozilla::ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + mozilla::ReentrantMonitor mReentrantMonitor; #ifdef XP_WIN mozilla::UniquePtr mWinWifiScanner; diff --git a/parser/html/nsHtml5StreamListener.h b/parser/html/nsHtml5StreamListener.h index e5f8ccdd4ff4..9a3da0cff87a 100644 --- a/parser/html/nsHtml5StreamListener.h +++ b/parser/html/nsHtml5StreamListener.h @@ -51,7 +51,7 @@ class nsHtml5StreamListener : public nsIStreamListener, // ReentrantMonitor instead of Mutex, because `GetDelegate()` // can be called from within the Necko callbacks when Necko events // are delivered on the main thread. - mozilla::ReentrantMonitor mDelegateMonitor MOZ_UNANNOTATED; + mozilla::ReentrantMonitor mDelegateMonitor; // Owning pointer with manually-managed refcounting, protected by // mDelegateMonitor. Access to it is Atomic, which avoids getting a lock // to check if it's set or to return the pointer. Access to the data within diff --git a/parser/html/nsHtml5StreamParser.h b/parser/html/nsHtml5StreamParser.h index 872a6b3a12fc..bc58ab9921ba 100644 --- a/parser/html/nsHtml5StreamParser.h +++ b/parser/html/nsHtml5StreamParser.h @@ -606,7 +606,7 @@ class nsHtml5StreamParser final : public nsISupports { * Makes sure the main thread can't mess the tokenizer state while it's * tokenizing. This mutex also protects the current speculation. */ - mozilla::Mutex mTokenizerMutex MOZ_UNANNOTATED; + mozilla::Mutex mTokenizerMutex; /** * The scoped atom table @@ -645,7 +645,7 @@ class nsHtml5StreamParser final : public nsISupports { * The current speculation is the last element */ nsTArray> mSpeculations; - mozilla::Mutex mSpeculationMutex MOZ_UNANNOTATED; + mozilla::Mutex mSpeculationMutex; /** * Number of times speculation has failed for this parser. @@ -727,7 +727,7 @@ class nsHtml5StreamParser final : public nsISupports { * Mutex for protecting access to mFlushTimer (but not for the two * mFlushTimerFoo booleans below). */ - mozilla::Mutex mFlushTimerMutex MOZ_UNANNOTATED; + mozilla::Mutex mFlushTimerMutex; /** * Keeps track whether mFlushTimer has been armed. Unfortunately, diff --git a/parser/html/nsHtml5TreeOpStage.h b/parser/html/nsHtml5TreeOpStage.h index 37cd3ed83b81..5e54e70c9123 100644 --- a/parser/html/nsHtml5TreeOpStage.h +++ b/parser/html/nsHtml5TreeOpStage.h @@ -54,7 +54,7 @@ class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink { private: nsTArray mOpQueue; nsTArray mSpeculativeLoadQueue; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; }; #endif /* nsHtml5TreeOpStage_h */ diff --git a/security/certverifier/OCSPCache.h b/security/certverifier/OCSPCache.h index 8566511cbd42..26278c1a1df4 100644 --- a/security/certverifier/OCSPCache.h +++ b/security/certverifier/OCSPCache.h @@ -120,7 +120,7 @@ class OCSPCache { /*out*/ size_t& index, const MutexAutoLock& aProofOfLock); void MakeMostRecentlyUsed(size_t aIndex, const MutexAutoLock& aProofOfLock); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; static const size_t MaxEntries = 1024; // Sorted with the most-recently-used entry at the end. // Using 256 here reserves as much possible inline storage as the vector diff --git a/security/manager/ssl/DataStorage.h b/security/manager/ssl/DataStorage.h index c3849ac20d3d..b42bb1dbdbfe 100644 --- a/security/manager/ssl/DataStorage.h +++ b/security/manager/ssl/DataStorage.h @@ -194,8 +194,7 @@ class DataStorage : public nsIObserver { nsTArray* aItems, const MutexAutoLock& aProofOfLock); - Mutex mMutex - MOZ_UNANNOTATED; // This mutex protects access to the following members: + Mutex mMutex; // This mutex protects access to the following members: DataStorageTable mPersistentDataTable; DataStorageTable mTemporaryDataTable; DataStorageTable mPrivateDataTable; @@ -209,8 +208,7 @@ class DataStorage : public nsIObserver { mozilla::Atomic mInitCalled; // Indicates that Init() has been called. - Monitor mReadyMonitor - MOZ_UNANNOTATED; // Do not acquire this at the same time as mMutex. + Monitor mReadyMonitor; // Do not acquire this at the same time as mMutex. bool mReady; // Indicates that saved data has been read and Get can proceed. const nsString mFilename; diff --git a/security/manager/ssl/PSMRunnable.h b/security/manager/ssl/PSMRunnable.h index 6d3deee903a9..3e74895fe16c 100644 --- a/security/manager/ssl/PSMRunnable.h +++ b/security/manager/ssl/PSMRunnable.h @@ -26,7 +26,7 @@ class SyncRunnableBase : public Runnable { virtual void RunOnTargetThread() = 0; private: - mozilla::Monitor monitor MOZ_UNANNOTATED; + mozilla::Monitor monitor; }; class NotifyObserverRunnable : public Runnable { diff --git a/security/manager/ssl/SharedSSLState.h b/security/manager/ssl/SharedSSLState.h index b6597967f089..0fd1e23710e9 100644 --- a/security/manager/ssl/SharedSSLState.h +++ b/security/manager/ssl/SharedSSLState.h @@ -62,7 +62,7 @@ class SharedSSLState { // True if any sockets have been created that use this shared data. // Requires synchronization between the socket and main threads for // reading/writing. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; bool mSocketCreated; bool mOCSPStaplingEnabled; bool mOCSPMustStapleEnabled; diff --git a/security/manager/ssl/TransportSecurityInfo.h b/security/manager/ssl/TransportSecurityInfo.h index 43d5d707bf44..efc51817b042 100644 --- a/security/manager/ssl/TransportSecurityInfo.h +++ b/security/manager/ssl/TransportSecurityInfo.h @@ -126,7 +126,7 @@ class TransportSecurityInfo : public nsITransportSecurityInfo, Atomic mCanceled; protected: - mutable ::mozilla::Mutex mMutex MOZ_UNANNOTATED; + mutable ::mozilla::Mutex mMutex; uint16_t mCipherSuite; uint16_t mProtocolVersion; @@ -236,7 +236,7 @@ class RememberCertErrorsTable { } private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; static RememberCertErrorsTable* sInstance; }; diff --git a/security/manager/ssl/nsCertOverrideService.h b/security/manager/ssl/nsCertOverrideService.h index 6f924246ee1c..e181a489f931 100644 --- a/security/manager/ssl/nsCertOverrideService.h +++ b/security/manager/ssl/nsCertOverrideService.h @@ -132,7 +132,7 @@ class nsCertOverrideService final : public nsICertOverrideService, private: ~nsCertOverrideService(); - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; bool mDisableAllSecurityCheck; nsCOMPtr mSettingsFile; nsTHashtable mSettingsTable; diff --git a/security/manager/ssl/nsNSSCallbacks.cpp b/security/manager/ssl/nsNSSCallbacks.cpp index 6a103f057122..fc5deba29bf0 100644 --- a/security/manager/ssl/nsNSSCallbacks.cpp +++ b/security/manager/ssl/nsNSSCallbacks.cpp @@ -104,7 +104,7 @@ class OCSPRequest final : public nsIStreamLoaderObserver, public nsIRunnable { // cancelled. This is how we know the closure in OnTimeout is valid. If the // timer fires before OnStreamComplete runs, it should be safe to not cancel // the request because necko has a strong reference to it. - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; bool mNotifiedDone; nsCOMPtr mLoader; const nsCString mAIALocation; diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp index eb589fc0b229..ba92682b8e21 100644 --- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -921,7 +921,7 @@ nsresult nsNSSComponent::BlockUntilLoadableCertsLoaded() { } #ifndef MOZ_NO_SMART_CARDS -static StaticMutex sCheckForSmartCardChangesMutex MOZ_UNANNOTATED; +static StaticMutex sCheckForSmartCardChangesMutex; static TimeStamp sLastCheckedForSmartCardChanges = TimeStamp::Now(); #endif diff --git a/security/manager/ssl/nsNSSComponent.h b/security/manager/ssl/nsNSSComponent.h index 4f2a92d436fc..ca51ad77461d 100644 --- a/security/manager/ssl/nsNSSComponent.h +++ b/security/manager/ssl/nsNSSComponent.h @@ -116,12 +116,12 @@ class nsNSSComponent final : public nsINSSComponent, public nsIObserver { nsresult MaybeEnableIntermediatePreloadingHealer(); // mLoadableCertsLoadedMonitor protects mLoadableCertsLoaded. - mozilla::Monitor mLoadableCertsLoadedMonitor MOZ_UNANNOTATED; + mozilla::Monitor mLoadableCertsLoadedMonitor; bool mLoadableCertsLoaded; nsresult mLoadableCertsLoadedResult; // mMutex protects all members that are accessed from more than one thread. - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; // The following members are accessed from more than one thread: diff --git a/security/manager/ssl/nsNSSIOLayer.h b/security/manager/ssl/nsNSSIOLayer.h index 4f7a253bda6e..af5ca0a3c3e1 100644 --- a/security/manager/ssl/nsNSSIOLayer.h +++ b/security/manager/ssl/nsNSSIOLayer.h @@ -338,7 +338,7 @@ class nsSSLIOLayerHelpers { uint16_t mVersionFallbackLimit; private: - mozilla::Mutex mutex MOZ_UNANNOTATED; + mozilla::Mutex mutex; nsCOMPtr mPrefObserver; uint32_t mTlsFlags; }; diff --git a/security/manager/ssl/nsProtectedAuthThread.h b/security/manager/ssl/nsProtectedAuthThread.h index 5ebac7262ee5..e968173fccb7 100644 --- a/security/manager/ssl/nsProtectedAuthThread.h +++ b/security/manager/ssl/nsProtectedAuthThread.h @@ -16,7 +16,7 @@ class nsIRunnable; class nsProtectedAuthThread : public nsIProtectedAuthThread { private: - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; nsCOMPtr mNotifyObserver; diff --git a/security/sandbox/common/test/SandboxTestingParent.h b/security/sandbox/common/test/SandboxTestingParent.h index 1899b11119d0..45bdbf0f766a 100644 --- a/security/sandbox/common/test/SandboxTestingParent.h +++ b/security/sandbox/common/test/SandboxTestingParent.h @@ -43,7 +43,7 @@ class SandboxTestingParent : public PSandboxTestingParent { void Bind(Endpoint&& aEnd); UniquePtr mThread; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; bool mShutdownDone; }; diff --git a/security/sandbox/linux/reporter/SandboxReporter.cpp b/security/sandbox/linux/reporter/SandboxReporter.cpp index 6512057b74f8..0d0534b42cf3 100644 --- a/security/sandbox/linux/reporter/SandboxReporter.cpp +++ b/security/sandbox/linux/reporter/SandboxReporter.cpp @@ -81,7 +81,7 @@ SandboxReporter::~SandboxReporter() { /* static */ SandboxReporter* SandboxReporter::Singleton() { - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; StaticMutexAutoLock lock(sMutex); if (sSingleton == nullptr) { diff --git a/security/sandbox/linux/reporter/SandboxReporter.h b/security/sandbox/linux/reporter/SandboxReporter.h index 0969111c9c04..d2dece787033 100644 --- a/security/sandbox/linux/reporter/SandboxReporter.h +++ b/security/sandbox/linux/reporter/SandboxReporter.h @@ -66,7 +66,7 @@ class SandboxReporter final : public PlatformThread::Delegate { int mServerFd; PlatformThreadHandle mThread; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // These are protected by mMutex: UniquePtr mBuffer; uint64_t mCount; diff --git a/startupcache/StartupCache.h b/startupcache/StartupCache.h index 1df2770308a1..cb34c8932251 100644 --- a/startupcache/StartupCache.h +++ b/startupcache/StartupCache.h @@ -217,7 +217,7 @@ class StartupCache : public nsIMemoryReporter { nsTArray mOldTables; nsCOMPtr mFile; loader::AutoMemMap mCacheData; - Mutex mTableLock MOZ_UNANNOTATED; + Mutex mTableLock; nsCOMPtr mObserverService; RefPtr mListener; diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index 27872b958843..f3dc0162d475 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -265,7 +265,7 @@ class UnlockNotification { } private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; CondVar mCondVar; bool mSignaled; }; diff --git a/storage/mozStorageConnection.h b/storage/mozStorageConnection.h index edfefda5b2a1..61a777ad8d77 100644 --- a/storage/mozStorageConnection.h +++ b/storage/mozStorageConnection.h @@ -167,7 +167,7 @@ class Connection final : public mozIStorageConnection, * - Connection.mConnectionClosed * - AsyncExecuteStatements.mCancelRequested */ - Mutex sharedAsyncExecutionMutex MOZ_UNANNOTATED; + Mutex sharedAsyncExecutionMutex; /** * Wraps the mutex that SQLite gives us from sqlite3_db_mutex. This is public diff --git a/storage/mozStorageService.h b/storage/mozStorageService.h index 7b2a5e595e06..3b40b07d41db 100644 --- a/storage/mozStorageService.h +++ b/storage/mozStorageService.h @@ -116,7 +116,7 @@ class Service : public mozIStorageService, * can ensure that the state of sqlite3_enable_shared_cache is sane and 2) * synchronizing access to mLocaleCollation. */ - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; struct AutoVFSRegistration { int Init(UniquePtr aVFS); @@ -136,7 +136,7 @@ class Service : public mozIStorageService, /** * Protects mConnections. */ - Mutex mRegistrationMutex MOZ_UNANNOTATED; + Mutex mRegistrationMutex; /** * The list of connections we have created. Modifications to it are diff --git a/storage/test/gtest/storage_test_harness.h b/storage/test/gtest/storage_test_harness.h index e30c4cb85df8..d1e1dbfaf6d7 100644 --- a/storage/test/gtest/storage_test_harness.h +++ b/storage/test/gtest/storage_test_harness.h @@ -300,7 +300,7 @@ class ThreadWedger : public mozilla::Runnable { } private: - mozilla::ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + mozilla::ReentrantMonitor mReentrantMonitor; bool unwedged; }; diff --git a/storage/test/gtest/test_unlock_notify.cpp b/storage/test/gtest/test_unlock_notify.cpp index 93cc5b09a845..c168b2cbef37 100644 --- a/storage/test/gtest/test_unlock_notify.cpp +++ b/storage/test/gtest/test_unlock_notify.cpp @@ -73,7 +73,7 @@ class DatabaseLocker : public mozilla::Runnable { do_check_success(monitor.Notify()); } - mozilla::ReentrantMonitor monitor MOZ_UNANNOTATED; + mozilla::ReentrantMonitor monitor; protected: nsCOMPtr mThread; diff --git a/toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp b/toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp index eda32471a877..b4ec6e9b16de 100644 --- a/toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp +++ b/toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp @@ -95,7 +95,7 @@ class BackgroundHangManager : public nsIObserver { static bool sDisabled; // Lock for access to members of this class - Monitor mLock MOZ_UNANNOTATED; + Monitor mLock; // Current time as seen by hang monitors TimeStamp mNow; // List of BackgroundHangThread instances associated with each thread diff --git a/toolkit/components/backgroundhangmonitor/HangAnnotations.h b/toolkit/components/backgroundhangmonitor/HangAnnotations.h index f6667efa42d5..35a7be70f957 100644 --- a/toolkit/components/backgroundhangmonitor/HangAnnotations.h +++ b/toolkit/components/backgroundhangmonitor/HangAnnotations.h @@ -52,7 +52,7 @@ class BackgroundHangAnnotators { BackgroundHangAnnotations GatherAnnotations(); private: - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; std::set mAnnotators; }; diff --git a/toolkit/components/extensions/webidl-api/ExtensionEventListener.h b/toolkit/components/extensions/webidl-api/ExtensionEventListener.h index 2137846aadb1..8fc46a3dfcda 100644 --- a/toolkit/components/extensions/webidl-api/ExtensionEventListener.h +++ b/toolkit/components/extensions/webidl-api/ExtensionEventListener.h @@ -112,7 +112,7 @@ class ExtensionEventListener final : public mozIExtensionEventListener { // Used to make sure we are not going to release the // instance on the worker thread, while we are in the // process of forwarding a call from the main thread. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; // A WorkerRunnable subclass used to call an ExtensionEventListener diff --git a/toolkit/components/extensions/webrequest/StreamFilterParent.h b/toolkit/components/extensions/webrequest/StreamFilterParent.h index 25f31b7c9c89..6a7b6cd0d02f 100644 --- a/toolkit/components/extensions/webrequest/StreamFilterParent.h +++ b/toolkit/components/extensions/webrequest/StreamFilterParent.h @@ -169,7 +169,7 @@ class StreamFilterParent final : public PStreamFilterParent, RefPtr mQueue; - Mutex mBufferMutex MOZ_UNANNOTATED; + Mutex mBufferMutex; bool mReceivedStop; bool mSentStop; diff --git a/toolkit/components/places/History.h b/toolkit/components/places/History.h index 71d77e5a166b..58e31b367a18 100644 --- a/toolkit/components/places/History.h +++ b/toolkit/components/places/History.h @@ -177,12 +177,12 @@ class History final : public BaseHistory, bool mShuttingDown; // This mutex guards mShuttingDown and should be acquired on the helper // thread. - Mutex mShuttingDownMutex MOZ_UNANNOTATED; + Mutex mShuttingDownMutex; // Code running in the helper thread can acquire this mutex to block shutdown // from proceeding until done, otherwise it may be impossible to get // statements to execute and an insert operation could be interrupted in the // middle. - Mutex mBlockShutdownMutex MOZ_UNANNOTATED; + Mutex mBlockShutdownMutex; // Allow private access from the helper thread to acquire mutexes. friend class InsertVisitedURIs; diff --git a/toolkit/components/telemetry/core/Telemetry.cpp b/toolkit/components/telemetry/core/Telemetry.cpp index 1b9b0c213d6e..cc7163b21a57 100644 --- a/toolkit/components/telemetry/core/Telemetry.cpp +++ b/toolkit/components/telemetry/core/Telemetry.cpp @@ -174,7 +174,7 @@ class TelemetryImpl final : public nsITelemetry, public nsIMemoryReporter { static StaticDataMutex sTelemetry; AutoHashtable mPrivateSQL; AutoHashtable mSanitizedSQL; - Mutex mHashMutex MOZ_UNANNOTATED; + Mutex mHashMutex; Atomic mCanRecordBase; Atomic mCanRecordExtended; diff --git a/toolkit/components/telemetry/core/TelemetryEvent.cpp b/toolkit/components/telemetry/core/TelemetryEvent.cpp index fe77ab91221b..21418c0570bb 100644 --- a/toolkit/components/telemetry/core/TelemetryEvent.cpp +++ b/toolkit/components/telemetry/core/TelemetryEvent.cpp @@ -676,7 +676,7 @@ nsresult SerializeEventsArray(const EventRecordArray& events, JSContext* cx, // that, due to the nature of Telemetry, we cannot rely on having a // mutex initialized in InitializeGlobalState. Unfortunately, we // cannot make sure that no other function is called before this point. -static StaticMutex gTelemetryEventsMutex MOZ_UNANNOTATED; +static StaticMutex gTelemetryEventsMutex; void TelemetryEvent::InitializeGlobalState(bool aCanRecordBase, bool aCanRecordExtended) { diff --git a/toolkit/components/telemetry/core/TelemetryHistogram.cpp b/toolkit/components/telemetry/core/TelemetryHistogram.cpp index d20f7cc50a88..ed69ddee0ecd 100644 --- a/toolkit/components/telemetry/core/TelemetryHistogram.cpp +++ b/toolkit/components/telemetry/core/TelemetryHistogram.cpp @@ -117,7 +117,7 @@ namespace TelemetryIPCAccumulator = mozilla::TelemetryIPCAccumulator; // a normal Mutex would show up as a leak in BloatView. StaticMutex // also has the "OffTheBooks" property, so it won't show as a leak // in BloatView. -static StaticMutex gTelemetryHistogramMutex MOZ_UNANNOTATED; +static StaticMutex gTelemetryHistogramMutex; //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/toolkit/components/telemetry/core/TelemetryOrigin.cpp b/toolkit/components/telemetry/core/TelemetryOrigin.cpp index 70bab61f3a85..4eb092e9df4a 100644 --- a/toolkit/components/telemetry/core/TelemetryOrigin.cpp +++ b/toolkit/components/telemetry/core/TelemetryOrigin.cpp @@ -108,7 +108,7 @@ namespace { // that, due to the nature of Telemetry, we cannot rely on having a // mutex initialized in InitializeGlobalState. Unfortunately, we // cannot make sure that no other function is called before this point. -static StaticMutex gTelemetryOriginMutex MOZ_UNANNOTATED; +static StaticMutex gTelemetryOriginMutex; typedef nsTArray> OriginHashesList; UniquePtr gOriginHashesList; diff --git a/toolkit/components/telemetry/core/TelemetryScalar.cpp b/toolkit/components/telemetry/core/TelemetryScalar.cpp index f404a26230fd..5d19b0496cf7 100644 --- a/toolkit/components/telemetry/core/TelemetryScalar.cpp +++ b/toolkit/components/telemetry/core/TelemetryScalar.cpp @@ -2429,7 +2429,7 @@ void internal_ApplyPendingOperations(const StaticMutexAutoLock& lock) { // that, due to the nature of Telemetry, we cannot rely on having a // mutex initialized in InitializeGlobalState. Unfortunately, we // cannot make sure that no other function is called before this point. -static StaticMutex gTelemetryScalarsMutex MOZ_UNANNOTATED; +static StaticMutex gTelemetryScalarsMutex; void TelemetryScalar::InitializeGlobalState(bool aCanRecordBase, bool aCanRecordExtended) { diff --git a/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp index 603cf01b6223..bb9a112fd179 100644 --- a/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp +++ b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp @@ -72,7 +72,7 @@ StaticAutoPtr> gChildEvents; // a normal Mutex would show up as a leak in BloatView. StaticMutex // also has the "OffTheBooks" property, so it won't show as a leak // in BloatView. -static StaticMutex gTelemetryIPCAccumulatorMutex MOZ_UNANNOTATED; +static StaticMutex gTelemetryIPCAccumulatorMutex; namespace { diff --git a/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp b/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp index 6c4b9590c0c9..91bb7eaebe72 100644 --- a/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp +++ b/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp @@ -36,7 +36,7 @@ void SendBatch(const StaticMutexAutoLock& aLock); // Topic on which we flush the batch. static const char* const kApplicationBackgroundTopic = "application-background"; -static StaticMutex gMutex MOZ_UNANNOTATED; +static StaticMutex gMutex; // -- The following state is accessed across threads. // -- Do not touch these if you do not hold gMutex. diff --git a/toolkit/components/url-classifier/VariableLengthPrefixSet.h b/toolkit/components/url-classifier/VariableLengthPrefixSet.h index 4f35a13226cc..21021d8212db 100644 --- a/toolkit/components/url-classifier/VariableLengthPrefixSet.h +++ b/toolkit/components/url-classifier/VariableLengthPrefixSet.h @@ -55,7 +55,7 @@ class VariableLengthPrefixSet final : public nsIMemoryReporter { // of the operations) and the main thread (which does memory reporting). // It should be held for all operations between Init() and destruction that // touch this class's data members. - mutable mozilla::Mutex mLock MOZ_UNANNOTATED; + mutable mozilla::Mutex mLock; const RefPtr mFixedPrefixSet; mozilla::safebrowsing::PrefixStringMap mVLPrefixSet; diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.h b/toolkit/components/url-classifier/nsUrlClassifierDBService.h index 6b5f736f7fc7..a5b79753190a 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.h +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.h @@ -251,7 +251,7 @@ class nsUrlClassifierDBServiceWorker final : public nsIUrlClassifierDBService { // Pending lookups are stored in a queue for processing. The queue // is protected by mPendingLookupLock. - mozilla::Mutex mPendingLookupLock MOZ_UNANNOTATED; + mozilla::Mutex mPendingLookupLock; class PendingLookup { public: diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h index 2216df40309d..722b5077fbd0 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h @@ -64,7 +64,7 @@ class nsUrlClassifierPrefixSet final : public nsIUrlClassifierPrefixSet { // of the operations) and the main thread (which does memory reporting). // It should be held for all operations between Init() and destruction that // touch this class's data members. - mutable mozilla::Mutex mLock MOZ_UNANNOTATED; + mutable mozilla::Mutex mLock; // list of fully stored prefixes, that also form the // start of a run of deltas in mIndexDeltas. nsTArray mIndexPrefixes; diff --git a/toolkit/components/url-classifier/nsUrlClassifierUtils.h b/toolkit/components/url-classifier/nsUrlClassifierUtils.h index 5ff9d97fdc64..656d98c73326 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierUtils.h +++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.h @@ -66,7 +66,7 @@ class nsUrlClassifierUtils final : public nsIUrlClassifierUtils, // The provider lookup table and its mutex. ProviderDictType mProviderDict; - mozilla::Mutex mProviderDictLock MOZ_UNANNOTATED; + mozilla::Mutex mProviderDictLock; }; #endif // nsUrlClassifierUtils_h_ diff --git a/toolkit/components/viaduct/ViaductRequest.h b/toolkit/components/viaduct/ViaductRequest.h index 2d268635984f..6455ce710107 100644 --- a/toolkit/components/viaduct/ViaductRequest.h +++ b/toolkit/components/viaduct/ViaductRequest.h @@ -43,7 +43,7 @@ class ViaductRequest final : public nsIStreamListener, nsCOMPtr mConnectTimeoutTimer; nsCOMPtr mReadTimeoutTimer; appservices::httpconfig::protobuf::Response mResponse; - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; ~ViaductRequest(); }; diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.h b/toolkit/components/windowwatcher/nsWindowWatcher.h index 7f967f69e33a..16c34f9e1529 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.h +++ b/toolkit/components/windowwatcher/nsWindowWatcher.h @@ -108,7 +108,7 @@ class nsWindowWatcher : public nsIWindowWatcher, protected: nsTArray mEnumeratorList; nsWatcherWindowEntry* mOldestWindow; - mozilla::Mutex mListLock MOZ_UNANNOTATED; + mozilla::Mutex mListLock; nsCOMPtr mWindowCreator; }; diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index b50e86651f7a..083d665b21e1 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -251,7 +251,7 @@ static bool sIncludeContextHeap = false; // OOP crash reporting static CrashGenerationServer* crashServer; // chrome process has this -static StaticMutex processMapLock MOZ_UNANNOTATED; +static StaticMutex processMapLock; static std::map processToCrashFd; static std::terminate_handler oldTerminateHandler = nullptr; diff --git a/toolkit/xre/dllservices/UntrustedModulesProcessor.h b/toolkit/xre/dllservices/UntrustedModulesProcessor.h index 1da5a25b2c61..ac69f40e97e5 100644 --- a/toolkit/xre/dllservices/UntrustedModulesProcessor.h +++ b/toolkit/xre/dllservices/UntrustedModulesProcessor.h @@ -150,8 +150,8 @@ class UntrustedModulesProcessor final : public nsIObserver { private: RefPtr mThread; - Mutex mUnprocessedMutex MOZ_UNANNOTATED; - Mutex mModuleCacheMutex MOZ_UNANNOTATED; + Mutex mUnprocessedMutex; + Mutex mModuleCacheMutex; // The members in this group are protected by mUnprocessedMutex UnprocessedModuleLoads mUnprocessedModuleLoads; diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index e128c8dd4f27..f2b870a14356 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -77,7 +77,7 @@ static void UpdateDriverSetupMacCommandLine(int& argc, char**& argv, // result from it, so we can't just dispatch and return, we have to wait // until the dispatched operation actually completes. So we also set up a // monitor to signal us when that happens, and block until then. - Monitor monitor MOZ_UNANNOTATED("nsUpdateDriver SetupMacCommandLine"); + Monitor monitor("nsUpdateDriver SetupMacCommandLine"); nsresult rv = NS_DispatchToMainThread(NS_NewRunnableFunction( "UpdateDriverSetupMacCommandLine", diff --git a/tools/performance/PerfStats.h b/tools/performance/PerfStats.h index 2a48bbf61e98..a8460e49cbe8 100644 --- a/tools/performance/PerfStats.h +++ b/tools/performance/PerfStats.h @@ -97,7 +97,7 @@ class PerfStats { nsCString CollectLocalPerfStatsJSONInternal(); static MetricMask sCollectionMask; - static StaticMutex sMutex MOZ_UNANNOTATED; + static StaticMutex sMutex; static StaticAutoPtr sSingleton; TimeStamp mRecordedStarts[static_cast(Metric::Max)]; double mRecordedTimes[static_cast(Metric::Max)]; diff --git a/tools/profiler/core/memory_hooks.cpp b/tools/profiler/core/memory_hooks.cpp index be83c6bf82ee..0b5e3f8e5345 100644 --- a/tools/profiler/core/memory_hooks.cpp +++ b/tools/profiler/core/memory_hooks.cpp @@ -278,7 +278,7 @@ class AllocationTracker { private: AllocationSet mAllocations; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; static AllocationTracker* gAllocationTracker; diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index 1fc3f0720c3c..92bcc1100687 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -3676,8 +3676,7 @@ class SamplerThread { // spy. This will ensure that the work doesn't take more than 50% of a CPU // core. int mDelaySpyStart = 0; - Monitor mSpyingStateMonitor MOZ_UNANNOTATED{ - "SamplerThread::mSpyingStateMonitor"}; + Monitor mSpyingStateMonitor{"SamplerThread::mSpyingStateMonitor"}; #elif defined(GP_OS_darwin) || defined(GP_OS_linux) || \ defined(GP_OS_android) || defined(GP_OS_freebsd) pthread_t mThread; diff --git a/tools/profiler/core/shared-libraries-macos.cc b/tools/profiler/core/shared-libraries-macos.cc index 606677de9d3d..80559c735b43 100644 --- a/tools/profiler/core/shared-libraries-macos.cc +++ b/tools/profiler/core/shared-libraries-macos.cc @@ -45,7 +45,7 @@ struct NativeSharedLibrary { std::string path; }; static std::vector* sSharedLibrariesList = nullptr; -static mozilla::StaticMutex sSharedLibrariesMutex MOZ_UNANNOTATED; +static mozilla::StaticMutex sSharedLibrariesMutex; static void SharedLibraryAddImage(const struct mach_header* mh, intptr_t vmaddr_slide) { diff --git a/widget/GfxInfoBase.h b/widget/GfxInfoBase.h index cd960ccb618f..d3d1a8537946 100644 --- a/widget/GfxInfoBase.h +++ b/widget/GfxInfoBase.h @@ -170,7 +170,7 @@ class GfxInfoBase : public nsIGfxInfo, bool BuildFeatureStateLog(JSContext* aCx, const gfx::FeatureState& aFeature, JS::MutableHandle aOut); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; } // namespace widget diff --git a/widget/VsyncDispatcher.h b/widget/VsyncDispatcher.h index e04e6ced3202..f322fb24e4a3 100644 --- a/widget/VsyncDispatcher.h +++ b/widget/VsyncDispatcher.h @@ -64,7 +64,7 @@ class CompositorVsyncDispatcher final { void ObserveVsync(bool aEnable); RefPtr mVsyncSource; - Mutex mCompositorObserverLock MOZ_UNANNOTATED; + Mutex mCompositorObserverLock; RefPtr mCompositorVsyncObserver; bool mDidShutdown; }; diff --git a/widget/android/EventDispatcher.h b/widget/android/EventDispatcher.h index c1fd60d60b87..a17822e248c4 100644 --- a/widget/android/EventDispatcher.h +++ b/widget/android/EventDispatcher.h @@ -77,7 +77,7 @@ class EventDispatcher final using ListenersMap = nsClassHashtable; - Mutex mLock MOZ_UNANNOTATED{"mozilla::widget::EventDispatcher"}; + Mutex mLock{"mozilla::widget::EventDispatcher"}; ListenersMap mListenersMap; using IterateEventsCallback = diff --git a/widget/android/jni/Natives.h b/widget/android/jni/Natives.h index 5fab5c62c098..c8df774fec35 100644 --- a/widget/android/jni/Natives.h +++ b/widget/android/jni/Natives.h @@ -618,7 +618,7 @@ class MOZ_HEAP_CLASS NativeWeakPtrControlBlock final { private: const mozilla::jni::Object::WeakRef mJavaOwner; - mutable RWLock mLock MOZ_UNANNOTATED; // Protects mNativeImpl + mutable RWLock mLock; // Protects mNativeImpl StorageType mNativeImpl; }; diff --git a/widget/android/nsAppShell.h b/widget/android/nsAppShell.h index 9b1dc5ca149d..4898809c53c9 100644 --- a/widget/android/nsAppShell.h +++ b/widget/android/nsAppShell.h @@ -164,7 +164,7 @@ class nsAppShell : public nsBaseAppShell { class Queue { private: - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; mozilla::LinkedList mQueue; public: diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index 2227e42b5520..44b1ae9fa31e 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -543,7 +543,7 @@ class nsChildView final : public nsBaseWidget { // Held while the compositor (or WR renderer) thread is compositing. // Protects from tearing down the view during compositing and from presenting // half-composited layers to the screen. - mozilla::Mutex mCompositingLock MOZ_UNANNOTATED; + mozilla::Mutex mCompositingLock; mozilla::ViewRegion mNonDraggableRegion; diff --git a/widget/cocoa/nsCocoaUtils.h b/widget/cocoa/nsCocoaUtils.h index b39c32717298..9249a964a792 100644 --- a/widget/cocoa/nsCocoaUtils.h +++ b/widget/cocoa/nsCocoaUtils.h @@ -499,7 +499,7 @@ class nsCocoaUtils { /** * Lock protecting |sVideoCapturePromises| and |sAudioCapturePromises|. */ - static StaticMutex sMediaCaptureMutex MOZ_UNANNOTATED; + static StaticMutex sMediaCaptureMutex; }; #endif // nsCocoaUtils_h_ diff --git a/widget/gtk/DMABufLibWrapper.cpp b/widget/gtk/DMABufLibWrapper.cpp index 285893c85c9c..b31cefc075ec 100644 --- a/widget/gtk/DMABufLibWrapper.cpp +++ b/widget/gtk/DMABufLibWrapper.cpp @@ -26,7 +26,7 @@ namespace widget { // Use static lock to protect dri operation as // gbm_dri.c is not thread safe. // https://gitlab.freedesktop.org/mesa/mesa/-/issues/4422 -mozilla::StaticMutex nsGbmLib::sDRILock MOZ_UNANNOTATED; +mozilla::StaticMutex nsGbmLib::sDRILock; void* nsGbmLib::sGbmLibHandle = nullptr; void* nsGbmLib::sXf86DrmLibHandle = nullptr; diff --git a/widget/gtk/DMABufLibWrapper.h b/widget/gtk/DMABufLibWrapper.h index ca7e6839c848..82a9dee9b682 100644 --- a/widget/gtk/DMABufLibWrapper.h +++ b/widget/gtk/DMABufLibWrapper.h @@ -153,7 +153,7 @@ class nsGbmLib { static void* sGbmLibHandle; static void* sXf86DrmLibHandle; - static mozilla::StaticMutex sDRILock MOZ_UNANNOTATED; + static mozilla::StaticMutex sDRILock; static bool sLibLoaded; }; diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h index 34e069726af3..23375d58b4c7 100644 --- a/widget/gtk/DMABufSurface.h +++ b/widget/gtk/DMABufSurface.h @@ -190,7 +190,7 @@ class DMABufSurface { int mGlobalRefCountFd; uint32_t mUID; - mozilla::Mutex mSurfaceLock MOZ_UNANNOTATED; + mozilla::Mutex mSurfaceLock; mozilla::gfx::ColorRange mColorRange = mozilla::gfx::ColorRange::LIMITED; }; diff --git a/widget/gtk/WaylandVsyncSource.h b/widget/gtk/WaylandVsyncSource.h index 75b3371a7d4d..37b6f539f8c8 100644 --- a/widget/gtk/WaylandVsyncSource.h +++ b/widget/gtk/WaylandVsyncSource.h @@ -73,7 +73,7 @@ class WaylandVsyncSource final : public gfx::VsyncSource { void CalculateVsyncRate(const MutexAutoLock& aProofOfLock, TimeStamp aVsyncTimestamp); - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; bool mIsShutdown; bool mVsyncEnabled; bool mMonitorEnabled; diff --git a/widget/gtk/WindowSurfaceProvider.h b/widget/gtk/WindowSurfaceProvider.h index a0d6315591c5..13f450851a09 100644 --- a/widget/gtk/WindowSurfaceProvider.h +++ b/widget/gtk/WindowSurfaceProvider.h @@ -75,7 +75,7 @@ class WindowSurfaceProvider final { * As nsWindow CleanupResources() call comes from Gtk/X11 we can't synchronize * that with WebRender so we use lock to synchronize the access. */ - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; // WindowSurface needs to be re-created as underlying window was changed. mozilla::Atomic mWindowSurfaceValid; #ifdef MOZ_WAYLAND diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.h b/widget/gtk/WindowSurfaceWaylandMultiBuffer.h index 3e26a1d5b1ff..3b336de43788 100644 --- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.h +++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.h @@ -54,7 +54,7 @@ class WindowSurfaceWaylandMB : public WindowSurface { const LayoutDeviceIntRegion& aInvalidRegion); void IncrementBufferAge(const MutexAutoLock& aProofOfLock); - mozilla::Mutex mSurfaceLock MOZ_UNANNOTATED; + mozilla::Mutex mSurfaceLock; RefPtr mWindow; LayoutDeviceIntSize mMozContainerSize; diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp index cd3f8689665f..f0e7413067ed 100644 --- a/widget/gtk/nsWaylandDisplay.cpp +++ b/widget/gtk/nsWaylandDisplay.cpp @@ -29,7 +29,7 @@ namespace widget { // where is wayland interface used as we need to dispatch waylands events // there. static RefPtr gWaylandDisplays[MAX_DISPLAY_CONNECTIONS]; -static StaticMutex gWaylandDisplayArrayWriteMutex MOZ_UNANNOTATED; +static StaticMutex gWaylandDisplayArrayWriteMutex; // Dispatch events to Compositor/Render queues void WaylandDispatchDisplays() { diff --git a/widget/windows/AudioSession.cpp b/widget/windows/AudioSession.cpp index 8bdc6af228cc..fce78d96e99b 100644 --- a/widget/windows/AudioSession.cpp +++ b/widget/windows/AudioSession.cpp @@ -89,7 +89,7 @@ class AudioSession final : public IAudioSessionEvents { nsID mSessionGroupingParameter; SessionState mState; // Guards the IAudioSessionControl - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; ThreadSafeAutoRefCnt mRefCnt; NS_DECL_OWNINGTHREAD diff --git a/widget/windows/InProcessWinCompositorWidget.h b/widget/windows/InProcessWinCompositorWidget.h index 8ef79bef7160..c4a9b6269d52 100644 --- a/widget/windows/InProcessWinCompositorWidget.h +++ b/widget/windows/InProcessWinCompositorWidget.h @@ -88,7 +88,7 @@ class InProcessWinCompositorWidget final gfx::CriticalSection mPresentLock; // Transparency handling. - mozilla::Mutex mTransparentSurfaceLock MOZ_UNANNOTATED; + mozilla::Mutex mTransparentSurfaceLock; mozilla::Atomic mTransparencyMode; diff --git a/widget/windows/JumpListBuilder.h b/widget/windows/JumpListBuilder.h index 70d3c1988148..11ca1ed9b287 100644 --- a/widget/windows/JumpListBuilder.h +++ b/widget/windows/JumpListBuilder.h @@ -50,7 +50,7 @@ class JumpListBuilder : public nsIJumpListBuilder, public nsIObserver { uint32_t mMaxItems; bool mHasCommit; nsCOMPtr mIOThread; - ReentrantMonitor mMonitor MOZ_UNANNOTATED; + ReentrantMonitor mMonitor; nsString mAppUserModelId; bool IsSeparator(nsCOMPtr& item); diff --git a/widget/windows/nsAppShell.h b/widget/windows/nsAppShell.h index 77502f5048eb..0c68d6b0a12d 100644 --- a/widget/windows/nsAppShell.h +++ b/widget/windows/nsAppShell.h @@ -53,7 +53,7 @@ class nsAppShell : public nsBaseAppShell { HWND mEventWnd; bool mNativeCallbackPending; - Mutex mLastNativeEventScheduledMutex MOZ_UNANNOTATED; + Mutex mLastNativeEventScheduledMutex; TimeStamp mLastNativeEventScheduled; std::vector mMsgsToRepost; }; diff --git a/widget/windows/nsPrinterWin.h b/widget/windows/nsPrinterWin.h index 8afcf14d0e97..7148413c3a84 100644 --- a/widget/windows/nsPrinterWin.h +++ b/widget/windows/nsPrinterWin.h @@ -47,7 +47,7 @@ class nsPrinterWin final : public nsPrinterBase { // see threading issues with multiple drivers. This Mutex is used to lock // around all calls to DeviceCapabilitiesW, DocumentPropertiesW and // CreateICW/DCW, to hopefully prevent these issues. - mutable mozilla::Mutex mDriverMutex MOZ_UNANNOTATED{"nsPrinterWin::Driver"}; + mutable mozilla::Mutex mDriverMutex{"nsPrinterWin::Driver"}; }; #endif // nsPrinterWin_h_ diff --git a/xpcom/base/AvailableMemoryWatcherLinux.cpp b/xpcom/base/AvailableMemoryWatcherLinux.cpp index c8e8510c17ce..121188d8846b 100644 --- a/xpcom/base/AvailableMemoryWatcherLinux.cpp +++ b/xpcom/base/AvailableMemoryWatcherLinux.cpp @@ -51,7 +51,7 @@ class nsAvailableMemoryWatcher final : public nsITimerCallback, // We might tell polling to start/stop from our polling thread // or from the main thread during ::Observe(). - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; // Polling interval to check for low memory. In high memory scenarios, // default to 5000 ms between each check. diff --git a/xpcom/base/AvailableMemoryWatcherWin.cpp b/xpcom/base/AvailableMemoryWatcherWin.cpp index 5ad52163b530..7b33047fcd5d 100644 --- a/xpcom/base/AvailableMemoryWatcherWin.cpp +++ b/xpcom/base/AvailableMemoryWatcherWin.cpp @@ -66,7 +66,7 @@ class nsAvailableMemoryWatcher final : public nsITimerCallback, // the main thread while the ::LowMemoryCallback() method is called by an // external thread. All functions called from those must acquire a lock on // this mutex before accessing the object's fields to prevent races. - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsCOMPtr mTimer; nsAutoHandle mLowMemoryHandle; HANDLE mWaitHandle; diff --git a/xpcom/base/RLBoxSandboxPool.h b/xpcom/base/RLBoxSandboxPool.h index 6b029af7adaa..1d0730a81386 100644 --- a/xpcom/base/RLBoxSandboxPool.h +++ b/xpcom/base/RLBoxSandboxPool.h @@ -63,7 +63,7 @@ class RLBoxSandboxPool : public nsITimerCallback, public nsINamed { nsTArray> mPool; const size_t mDelaySeconds; nsCOMPtr mTimer; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; }; // The RLBoxSandboxDataBase class serves as the subclass for all sandbox data diff --git a/xpcom/base/nsConsoleService.h b/xpcom/base/nsConsoleService.h index 7399138e8495..37b7d2e33638 100644 --- a/xpcom/base/nsConsoleService.h +++ b/xpcom/base/nsConsoleService.h @@ -106,7 +106,7 @@ class nsConsoleService final : public nsIConsoleService, public nsIObserver { ListenerHash mListeners; // To serialize interesting methods. - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; }; #endif /* __nsconsoleservice_h__ */ diff --git a/xpcom/base/nsDumpUtils.h b/xpcom/base/nsDumpUtils.h index f18d46d6a38a..0df3fa78d66f 100644 --- a/xpcom/base/nsDumpUtils.h +++ b/xpcom/base/nsDumpUtils.h @@ -125,7 +125,7 @@ class FifoWatcher : public FdWatcher { explicit FifoWatcher(nsCString aPath) : mDirPath(aPath), mFifoInfoLock("FifoWatcher.mFifoInfoLock") {} - mozilla::Mutex mFifoInfoLock MOZ_UNANNOTATED; // protects mFifoInfo + mozilla::Mutex mFifoInfoLock; // protects mFifoInfo FifoInfoArray mFifoInfo; }; @@ -159,7 +159,7 @@ class SignalPipeWatcher : public FdWatcher { MOZ_ASSERT(NS_IsMainThread()); } - mozilla::Mutex mSignalInfoLock MOZ_UNANNOTATED; // protects mSignalInfo + mozilla::Mutex mSignalInfoLock; // protects mSignalInfo SignalInfoArray mSignalInfo; }; diff --git a/xpcom/base/nsMacUtilsImpl.h b/xpcom/base/nsMacUtilsImpl.h index c2e0eb202ec3..7d9c1d6c93b3 100644 --- a/xpcom/base/nsMacUtilsImpl.h +++ b/xpcom/base/nsMacUtilsImpl.h @@ -70,7 +70,7 @@ class nsMacUtilsImpl final : public nsIMacUtils { // Cache the appDir returned from GetAppPath to avoid doing I/O static StaticAutoPtr sCachedAppPath; // For thread safe setting/checking of sCachedAppPath - static StaticMutex sCachedAppPathMutex MOZ_UNANNOTATED; + static StaticMutex sCachedAppPathMutex; // Utility method to call ClearOnShutdown() on the main thread static nsresult ClearCachedAppPathOnShutdown(); #endif diff --git a/xpcom/base/nsMemoryReporterManager.h b/xpcom/base/nsMemoryReporterManager.h index 523db55350f5..fd74f453d65b 100644 --- a/xpcom/base/nsMemoryReporterManager.h +++ b/xpcom/base/nsMemoryReporterManager.h @@ -209,7 +209,7 @@ class nsMemoryReporterManager final : public nsIMemoryReporterManager, // possibility of DMD reports and/or running on a low-end phone. static const uint32_t kTimeoutLengthMS = 180000; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; bool mIsRegistrationBlocked; StrongReportersTable* mStrongReporters; diff --git a/xpcom/build/IOInterposer.cpp b/xpcom/build/IOInterposer.cpp index bf0a103a5673..cb4471cd7c7d 100644 --- a/xpcom/build/IOInterposer.cpp +++ b/xpcom/build/IOInterposer.cpp @@ -304,7 +304,7 @@ class MasterList { // unregister observers during shutdown an OffTheBooksMutex is not an option // either, as its base calls into sDeadlockDetector which may be nullptr // during shutdown. - mozilla::IOInterposer::Mutex mLock MOZ_UNANNOTATED; + mozilla::IOInterposer::Mutex mLock; // Flags tracking which operations are being observed mozilla::Atomic diff --git a/xpcom/build/MainThreadIOLogger.cpp b/xpcom/build/MainThreadIOLogger.cpp index 6416a52c9e25..c085484a69c9 100644 --- a/xpcom/build/MainThreadIOLogger.cpp +++ b/xpcom/build/MainThreadIOLogger.cpp @@ -55,7 +55,7 @@ class MainThreadIOLoggerImpl final : public mozilla::IOInterposeObserver { mozilla::TimeStamp mLogStartTime; const char* mFileName; PRThread* mIOThread; - mozilla::IOInterposer::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::IOInterposer::Monitor mMonitor; bool mShutdownRequired; std::vector mObservations; }; diff --git a/xpcom/components/nsCategoryManager.h b/xpcom/components/nsCategoryManager.h index 770d11c82c75..c85e5212e916 100644 --- a/xpcom/components/nsCategoryManager.h +++ b/xpcom/components/nsCategoryManager.h @@ -84,7 +84,7 @@ class CategoryNode { void* operator new(size_t aSize, CategoryAllocator* aArena); nsTHashtable mTable; - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; }; /** @@ -138,7 +138,7 @@ class nsCategoryManager final : public nsICategoryManager, CategoryAllocator mArena; nsClassHashtable mTable; - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; bool mSuppressNotifications; }; diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h index 7e6bd7198b8a..4722e23625ff 100644 --- a/xpcom/components/nsComponentManager.h +++ b/xpcom/components/nsComponentManager.h @@ -105,7 +105,7 @@ class nsComponentManagerImpl final : public nsIComponentManager, nsTHashMap mFactories; nsTHashMap mContractIDs; - mozilla::Monitor mLock MOZ_UNANNOTATED; + mozilla::Monitor mLock; mozilla::Maybe LookupByCID(const nsID& aCID); mozilla::Maybe LookupByCID(const mozilla::MonitorAutoLock&, diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index 1a6c4bfabe86..d3117a05cfef 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -186,7 +186,7 @@ static AtomCache sRecentlyUsedMainThreadAtoms; // ConcurrentHashTable. class nsAtomSubTable { friend class nsAtomTable; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; PLDHashTable mTable; nsAtomSubTable(); void GCLocked(GCKind aKind); diff --git a/xpcom/io/FilePreferences.cpp b/xpcom/io/FilePreferences.cpp index 2feaa611efce..f2cf70a44fcb 100644 --- a/xpcom/io/FilePreferences.cpp +++ b/xpcom/io/FilePreferences.cpp @@ -21,7 +21,7 @@ namespace mozilla { namespace FilePreferences { -static StaticMutex sMutex MOZ_UNANNOTATED; +static StaticMutex sMutex; static bool sBlockUNCPaths = false; typedef nsTArray WinPaths; diff --git a/xpcom/io/InputStreamLengthWrapper.h b/xpcom/io/InputStreamLengthWrapper.h index 89b6233e35a6..a074d3cdcf6d 100644 --- a/xpcom/io/InputStreamLengthWrapper.h +++ b/xpcom/io/InputStreamLengthWrapper.h @@ -79,7 +79,7 @@ class InputStreamLengthWrapper final : public nsIAsyncInputStream, int64_t mLength; bool mConsumed; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; // This is used for AsyncWait and it's protected by mutex. nsCOMPtr mAsyncWaitCallback; diff --git a/xpcom/io/NonBlockingAsyncInputStream.h b/xpcom/io/NonBlockingAsyncInputStream.h index 1f9835397590..b026e39331b5 100644 --- a/xpcom/io/NonBlockingAsyncInputStream.h +++ b/xpcom/io/NonBlockingAsyncInputStream.h @@ -65,7 +65,7 @@ class NonBlockingAsyncInputStream final : public nsIAsyncInputStream, nsISeekableStream* MOZ_NON_OWNING_REF mWeakSeekableInputStream; nsITellableStream* MOZ_NON_OWNING_REF mWeakTellableInputStream; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; struct WaitClosureOnly { WaitClosureOnly(AsyncWaitRunnable* aRunnable, nsIEventTarget* aEventTarget); diff --git a/xpcom/io/SeekableStreamWrapper.h b/xpcom/io/SeekableStreamWrapper.h index 986f8ef55230..19620000cb0c 100644 --- a/xpcom/io/SeekableStreamWrapper.h +++ b/xpcom/io/SeekableStreamWrapper.h @@ -82,7 +82,7 @@ class SeekableStreamWrapper final : public nsIAsyncInputStream, nsCOMPtr mOriginal; // This mutex guards `mCurrent`. - Mutex mMutex MOZ_UNANNOTATED{"SeekableStreamWrapper"}; + Mutex mMutex{"SeekableStreamWrapper"}; nsCOMPtr mCurrent; }; diff --git a/xpcom/io/SlicedInputStream.h b/xpcom/io/SlicedInputStream.h index c94b9683533a..fb4ace0a2c8a 100644 --- a/xpcom/io/SlicedInputStream.h +++ b/xpcom/io/SlicedInputStream.h @@ -99,7 +99,7 @@ class SlicedInputStream final : public nsIAsyncInputStream, // This is protected by mutex. nsCOMPtr mAsyncWaitLengthCallback; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; }; } // namespace mozilla diff --git a/xpcom/io/nsMultiplexInputStream.cpp b/xpcom/io/nsMultiplexInputStream.cpp index f27d52d59a7d..5249cf2e44b4 100644 --- a/xpcom/io/nsMultiplexInputStream.cpp +++ b/xpcom/io/nsMultiplexInputStream.cpp @@ -139,7 +139,7 @@ class nsMultiplexInputStream final : public nsIMultiplexInputStream, bool IsInputStreamLength() const; bool IsAsyncInputStreamLength() const; - Mutex mLock MOZ_UNANNOTATED; // Protects access to all data members. + Mutex mLock; // Protects access to all data members. nsTArray mStreams; diff --git a/xpcom/io/nsPipe3.cpp b/xpcom/io/nsPipe3.cpp index a885b2a41375..9fc6c0543f43 100644 --- a/xpcom/io/nsPipe3.cpp +++ b/xpcom/io/nsPipe3.cpp @@ -342,7 +342,7 @@ class nsPipe final : public nsIPipe { // in mInputList as a weak ref. RefPtr mOriginalInput; - ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; + ReentrantMonitor mReentrantMonitor; nsSegmentedBuffer mBuffer; // The maximum number of segments to allow to be buffered in advance diff --git a/xpcom/io/nsStreamUtils.cpp b/xpcom/io/nsStreamUtils.cpp index ffea2173155c..aa0e93206991 100644 --- a/xpcom/io/nsStreamUtils.cpp +++ b/xpcom/io/nsStreamUtils.cpp @@ -463,7 +463,7 @@ class nsAStreamCopier : public nsIInputStreamCallback, nsCOMPtr mAsyncSource; nsCOMPtr mAsyncSink; nsCOMPtr mTarget; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; nsAsyncCopyCallbackFun mCallback; nsAsyncCopyProgressFun mProgressCallback; void* mClosure; diff --git a/xpcom/io/nsStringStream.cpp b/xpcom/io/nsStringStream.cpp index 1c25be94b69e..2b3d20bab395 100644 --- a/xpcom/io/nsStringStream.cpp +++ b/xpcom/io/nsStringStream.cpp @@ -144,7 +144,7 @@ class nsStringInputStream final : public nsIStringInputStream, RefPtr mSource; size_t mOffset = 0; - mozilla::ReentrantMonitor mMon MOZ_UNANNOTATED{"nsStringInputStream"}; + mozilla::ReentrantMonitor mMon{"nsStringInputStream"}; }; nsresult nsStringInputStream::Init(nsCString&& aString) { diff --git a/xpcom/rust/gtest/bench-collections/Bench.cpp b/xpcom/rust/gtest/bench-collections/Bench.cpp index 41152470c778..5ed462993890 100644 --- a/xpcom/rust/gtest/bench-collections/Bench.cpp +++ b/xpcom/rust/gtest/bench-collections/Bench.cpp @@ -272,7 +272,7 @@ class BenchCollections : public ::testing::Test { // A mutex that protects all benchmark operations, ensuring that two // benchmarks never run concurrently. - static StaticMutex sValsMutex MOZ_UNANNOTATED; + static StaticMutex sValsMutex; }; void** BenchCollections::sVals; diff --git a/xpcom/tests/gtest/TestDeadlockDetector.cpp b/xpcom/tests/gtest/TestDeadlockDetector.cpp index c9a4f1a3de28..2fa0036fd40f 100644 --- a/xpcom/tests/gtest/TestDeadlockDetector.cpp +++ b/xpcom/tests/gtest/TestDeadlockDetector.cpp @@ -159,7 +159,7 @@ TEST_F(TESTNAME(DeadlockDetectorTest), TESTNAME(Sanity3DeathTest)) static int Sanity4_Child() { DisableCrashReporter(); - mozilla::ReentrantMonitor m1 MOZ_UNANNOTATED("dd.sanity4.m1"); + mozilla::ReentrantMonitor m1("dd.sanity4.m1"); MUTEX m2("dd.sanity4.m2"); m1.Enter(); m2.Lock(); @@ -182,7 +182,7 @@ TEST_F(TESTNAME(DeadlockDetectorTest), TESTNAME(Sanity4DeathTest)) { static int Sanity5_Child() { DisableCrashReporter(); - mozilla::RecursiveMutex m1 MOZ_UNANNOTATED("dd.sanity4.m1"); + mozilla::RecursiveMutex m1("dd.sanity4.m1"); MUTEX m2("dd.sanity4.m2"); m1.Lock(); m2.Lock(); diff --git a/xpcom/tests/gtest/TestDelayedRunnable.cpp b/xpcom/tests/gtest/TestDelayedRunnable.cpp index f2926c4b198c..53461d755d81 100644 --- a/xpcom/tests/gtest/TestDelayedRunnable.cpp +++ b/xpcom/tests/gtest/TestDelayedRunnable.cpp @@ -127,7 +127,7 @@ TEST(DelayedRunnable, TimerFiresBeforeRunnableRuns) auto noTailTaskQueue = MakeRefPtr( do_AddRef(pool), "TestDelayedRunnable noTailTaskQueue", /* aSupportsTailDispatch = */ false); - Monitor outerMonitor MOZ_UNANNOTATED(__func__); + Monitor outerMonitor(__func__); MonitorAutoLock lock(outerMonitor); MOZ_ALWAYS_SUCCEEDS( tailTaskQueue1->Dispatch(NS_NewRunnableFunction(__func__, [&] { @@ -137,7 +137,7 @@ TEST(DelayedRunnable, TimerFiresBeforeRunnableRuns) EXPECT_TRUE(tailTaskQueue1->RequiresTailDispatch(tailTaskQueue2)); tailTaskQueue2->DelayedDispatch( NS_NewRunnableFunction(__func__, [&] {}), 1); - Monitor innerMonitor MOZ_UNANNOTATED(__func__); + Monitor innerMonitor(__func__); MonitorAutoLock lock(innerMonitor); auto timer = MakeRefPtr(); timer->WaitFor(mozilla::TimeDuration::FromMilliseconds(1), __func__) diff --git a/xpcom/tests/gtest/TestRWLock.cpp b/xpcom/tests/gtest/TestRWLock.cpp index 481400163bbb..b300695be768 100644 --- a/xpcom/tests/gtest/TestRWLock.cpp +++ b/xpcom/tests/gtest/TestRWLock.cpp @@ -69,7 +69,7 @@ RWLockRunnable::Run() { TEST(RWLock, SmokeTest) { nsCOMPtr threads[sNumThreads]; - RWLock rwlock MOZ_UNANNOTATED("test lock"); + RWLock rwlock("test lock"); mozilla::Atomic data(0); for (size_t i = 0; i < sNumThreads; ++i) { @@ -103,7 +103,7 @@ static std::invoke_result_t RunOnBackgroundThread( TEST(RWLock, AutoTryReadLock) { - RWLock l1 MOZ_UNANNOTATED("autotryreadlock"); + RWLock l1("autotryreadlock"); { AutoTryReadLock autol1(l1); @@ -121,7 +121,7 @@ TEST(RWLock, AutoTryReadLock) EXPECT_TRUE(autol2); { - RWLock l2 MOZ_UNANNOTATED("autotryreadlock2"); + RWLock l2("autotryreadlock2"); AutoTryReadLock autol3(l2); EXPECT_TRUE(autol3); @@ -155,7 +155,7 @@ TEST(RWLock, AutoTryReadLock) TEST(RWLock, AutoTryWriteLock) { - RWLock l1 MOZ_UNANNOTATED("autotrywritelock"); + RWLock l1("autotrywritelock"); { AutoTryWriteLock autol1(l1); @@ -173,7 +173,7 @@ TEST(RWLock, AutoTryWriteLock) EXPECT_FALSE(autol2); { - RWLock l2 MOZ_UNANNOTATED("autotrywritelock2"); + RWLock l2("autotrywritelock2"); AutoTryWriteLock autol3(l2); EXPECT_TRUE(autol3); diff --git a/xpcom/tests/gtest/TestSynchronization.cpp b/xpcom/tests/gtest/TestSynchronization.cpp index 8e808586e26c..e994d9bc276c 100644 --- a/xpcom/tests/gtest/TestSynchronization.cpp +++ b/xpcom/tests/gtest/TestSynchronization.cpp @@ -218,13 +218,13 @@ TEST(Synchronization, CondVarSanity) // TEST(Synchronization, AutoLock) { - Mutex l1 MOZ_UNANNOTATED("autolock"); + Mutex l1("autolock"); MutexAutoLock autol1(l1); l1.AssertCurrentThreadOwns(); { - Mutex l2 MOZ_UNANNOTATED("autolock2"); + Mutex l2("autolock2"); MutexAutoLock autol2(l2); l1.AssertCurrentThreadOwns(); @@ -239,7 +239,7 @@ TEST(Synchronization, AutoLock) // TEST(Synchronization, AutoTryLock) { - Mutex l1 MOZ_UNANNOTATED("autotrylock"); + Mutex l1("autotrylock"); MutexAutoTryLock autol1(l1); EXPECT_TRUE(autol1); @@ -252,7 +252,7 @@ TEST(Synchronization, AutoTryLock) l1.AssertCurrentThreadOwns(); { - Mutex l2 MOZ_UNANNOTATED("autotrylock2"); + Mutex l2("autotrylock2"); MutexAutoTryLock autol3(l2); EXPECT_TRUE(autol3); @@ -268,8 +268,8 @@ TEST(Synchronization, AutoTryLock) // TEST(Synchronization, AutoUnlock) { - Mutex l1 MOZ_UNANNOTATED("autounlock"); - Mutex l2 MOZ_UNANNOTATED("autounlock2"); + Mutex l1("autounlock"); + Mutex l2("autounlock2"); l1.Lock(); l1.AssertCurrentThreadOwns(); diff --git a/xpcom/tests/gtest/TestTaskQueue.cpp b/xpcom/tests/gtest/TestTaskQueue.cpp index fe09567ed133..6d45c9d561fe 100644 --- a/xpcom/tests/gtest/TestTaskQueue.cpp +++ b/xpcom/tests/gtest/TestTaskQueue.cpp @@ -29,7 +29,7 @@ TEST(TaskQueue, EventOrder) bool errored = false; int counter = 0; int sync = 0; - Monitor monitor MOZ_UNANNOTATED("TaskQueue::EventOrder::monitor"); + Monitor monitor("TaskQueue::EventOrder::monitor"); // We expect task1 happens before task3. for (int i = 0; i < 10000; ++i) { diff --git a/xpcom/tests/gtest/TestThreadPool.cpp b/xpcom/tests/gtest/TestThreadPool.cpp index eefcfaca6490..b80feb011647 100644 --- a/xpcom/tests/gtest/TestThreadPool.cpp +++ b/xpcom/tests/gtest/TestThreadPool.cpp @@ -110,7 +110,7 @@ TEST(ThreadPool, Parallelism) // We should wake up the idle thread and spawn a new thread so these 2 events // can run in parallel. We will time out if r1 and r2 run in sequence for r1 // won't finish until r2 finishes. - Monitor mon MOZ_UNANNOTATED("ThreadPool::Parallelism"); + Monitor mon("ThreadPool::Parallelism"); bool done = false; nsCOMPtr r1 = new Runnable1(mon, done); nsCOMPtr r2 = new Runnable2(mon, done); diff --git a/xpcom/tests/gtest/TestThrottledEventQueue.cpp b/xpcom/tests/gtest/TestThrottledEventQueue.cpp index 834e6c081326..f3b7828f07ee 100644 --- a/xpcom/tests/gtest/TestThrottledEventQueue.cpp +++ b/xpcom/tests/gtest/TestThrottledEventQueue.cpp @@ -254,7 +254,7 @@ TEST(ThrottledEventQueue, DropWhileRunning) TEST(ThrottledEventQueue, AwaitIdle) { - Mutex mutex MOZ_UNANNOTATED("TEQ AwaitIdle"); + Mutex mutex("TEQ AwaitIdle"); CondVar cond(mutex, "TEQ AwaitIdle"); string dequeue_await; // mutex @@ -317,7 +317,7 @@ TEST(ThrottledEventQueue, AwaitIdleMixed) ASSERT_TRUE(NS_SUCCEEDED( NS_NewNamedThread("AwaitIdleMixed", getter_AddRefs(thread)))); - Mutex mutex MOZ_UNANNOTATED("AwaitIdleMixed"); + Mutex mutex("AwaitIdleMixed"); CondVar cond(mutex, "AwaitIdleMixed"); // The following are protected by mutex and cond, above. @@ -480,7 +480,7 @@ TEST(ThrottledEventQueue, MixedPauseResume) TEST(ThrottledEventQueue, AwaitIdlePaused) { - Mutex mutex MOZ_UNANNOTATED("AwaitIdlePaused"); + Mutex mutex("AwaitIdlePaused"); CondVar cond(mutex, "AwaitIdlePaused"); string dequeue_await; // mutex diff --git a/xpcom/tests/gtest/TestTimers.cpp b/xpcom/tests/gtest/TestTimers.cpp index ae4c075794dd..e45d8b0a179a 100644 --- a/xpcom/tests/gtest/TestTimers.cpp +++ b/xpcom/tests/gtest/TestTimers.cpp @@ -173,7 +173,7 @@ class TimerHelper { private: TimeStamp mStart; RefPtr mTimer; - mutable Monitor mMonitor MOZ_UNANNOTATED; + mutable Monitor mMonitor; uint32_t mBlockTime = 0; Maybe mLastDelay; RefPtr mTarget; diff --git a/xpcom/threads/BlockingResourceBase.h b/xpcom/threads/BlockingResourceBase.h index 8bb7a78f6f65..abf89d53a806 100644 --- a/xpcom/threads/BlockingResourceBase.h +++ b/xpcom/threads/BlockingResourceBase.h @@ -9,7 +9,6 @@ #include "mozilla/MemoryReporting.h" #include "mozilla/ThreadLocal.h" -#include "mozilla/Attributes.h" #include "nscore.h" #include "nsDebug.h" diff --git a/xpcom/threads/LazyIdleThread.h b/xpcom/threads/LazyIdleThread.h index 2db2456e309e..433518f76499 100644 --- a/xpcom/threads/LazyIdleThread.h +++ b/xpcom/threads/LazyIdleThread.h @@ -131,7 +131,7 @@ class LazyIdleThread final : public nsIThread, /** * Protects data that is accessed on both threads. */ - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; /** * Touched on both threads but set before mThread is created. Used to direct diff --git a/xpcom/threads/MozPromise.h b/xpcom/threads/MozPromise.h index 5540bd507fdd..dbd05c1b17ff 100644 --- a/xpcom/threads/MozPromise.h +++ b/xpcom/threads/MozPromise.h @@ -1172,7 +1172,7 @@ class MozPromise : public MozPromiseBase { }; const char* mCreationSite; // For logging - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; ResolveOrRejectValue mValue; bool mUseSynchronousTaskDispatch = false; bool mUseDirectTaskDispatch = false; diff --git a/xpcom/threads/SpinEventLoopUntil.h b/xpcom/threads/SpinEventLoopUntil.h index 1e2735a36cab..6825be3d453b 100644 --- a/xpcom/threads/SpinEventLoopUntil.h +++ b/xpcom/threads/SpinEventLoopUntil.h @@ -131,7 +131,7 @@ struct MOZ_STACK_CLASS AutoNestedEventLoopAnnotation { // The declarations of these statics live in nsThreadManager.cpp. static AutoNestedEventLoopAnnotation* sCurrent; - static StaticMutex sStackMutex MOZ_UNANNOTATED; + static StaticMutex sStackMutex; // We need this to avoid the inclusion of nsExceptionHandler.h here // which can include windows.h which disturbs some dom/media/gtest. diff --git a/xpcom/threads/SyncRunnable.h b/xpcom/threads/SyncRunnable.h index 898b76f52952..49235e764aa6 100644 --- a/xpcom/threads/SyncRunnable.h +++ b/xpcom/threads/SyncRunnable.h @@ -124,7 +124,7 @@ class SyncRunnable : public Runnable { private: nsCOMPtr mRunnable; - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; bool mDone; }; diff --git a/xpcom/threads/TaskController.h b/xpcom/threads/TaskController.h index f9479bafd14b..5b7ff046be73 100644 --- a/xpcom/threads/TaskController.h +++ b/xpcom/threads/TaskController.h @@ -371,10 +371,10 @@ class TaskController { void RunPoolThread(); static std::unique_ptr sSingleton; - static StaticMutex sSingletonMutex MOZ_UNANNOTATED; + static StaticMutex sSingletonMutex; // This protects access to the task graph. - Mutex mGraphMutex MOZ_UNANNOTATED; + Mutex mGraphMutex; // This protects thread pool initialization. We cannot do this from within // the GraphMutex, since thread creation on Windows can generate events on diff --git a/xpcom/threads/TaskQueue.h b/xpcom/threads/TaskQueue.h index 389221cf36e2..2b318ef5180a 100644 --- a/xpcom/threads/TaskQueue.h +++ b/xpcom/threads/TaskQueue.h @@ -154,7 +154,7 @@ class TaskQueue : public AbstractThread, // Monitor that protects the queue, mIsRunning and // mDelayedRunnablesCancelPromise; - Monitor mQueueMonitor MOZ_UNANNOTATED; + Monitor mQueueMonitor; typedef struct TaskStruct { nsCOMPtr event; diff --git a/xpcom/threads/ThreadEventQueue.h b/xpcom/threads/ThreadEventQueue.h index 74edb8c96fcd..14479cb5c5b2 100644 --- a/xpcom/threads/ThreadEventQueue.h +++ b/xpcom/threads/ThreadEventQueue.h @@ -74,7 +74,7 @@ class ThreadEventQueue final : public SynchronizedEventQueue { nsTArray mNestedQueues; - Mutex mLock MOZ_UNANNOTATED; + Mutex mLock; CondVar mEventsAvailable; bool mEventsAreDoomed = false; diff --git a/xpcom/threads/ThrottledEventQueue.cpp b/xpcom/threads/ThrottledEventQueue.cpp index 5584207d1328..578d7a4cd726 100644 --- a/xpcom/threads/ThrottledEventQueue.cpp +++ b/xpcom/threads/ThrottledEventQueue.cpp @@ -94,7 +94,7 @@ class ThrottledEventQueue::Inner final : public nsISupports { #endif }; - mutable Mutex mMutex MOZ_UNANNOTATED; + mutable Mutex mMutex; mutable CondVar mIdleCondVar; // As-of-yet unexecuted runnables queued on this ThrottledEventQueue. diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index 4e1d1fb121bb..a7b66370e9b5 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -98,7 +98,7 @@ class TimerEventAllocator { ArenaAllocator<4096> mPool; FreeEntry* mFirstFree; - mozilla::Monitor mMonitor MOZ_UNANNOTATED; + mozilla::Monitor mMonitor; public: TimerEventAllocator() diff --git a/xpcom/threads/TimerThread.h b/xpcom/threads/TimerThread.h index 6656ce569469..f2ee487a6668 100644 --- a/xpcom/threads/TimerThread.h +++ b/xpcom/threads/TimerThread.h @@ -78,7 +78,7 @@ class TimerThread final : public mozilla::Runnable, public nsIObserver { // (optional) ThreadWrapper::sMutex -> // (optional) nsTimerImpl::mMutex -> // TimerThread::mMonitor - Monitor mMonitor MOZ_UNANNOTATED; + Monitor mMonitor; bool mShutdown; bool mWaiting; diff --git a/xpcom/threads/nsEnvironment.h b/xpcom/threads/nsEnvironment.h index 9187b8df8242..acc9200bac2e 100644 --- a/xpcom/threads/nsEnvironment.h +++ b/xpcom/threads/nsEnvironment.h @@ -30,7 +30,7 @@ class nsEnvironment final : public nsIEnvironment { nsEnvironment() : mLock("nsEnvironment.mLock") {} ~nsEnvironment(); - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; }; #endif /* !nsEnvironment_h__ */ diff --git a/xpcom/threads/nsProcess.h b/xpcom/threads/nsProcess.h index 9d80f8ea5a81..9a7105945e3b 100644 --- a/xpcom/threads/nsProcess.h +++ b/xpcom/threads/nsProcess.h @@ -58,7 +58,7 @@ class nsProcess final : public nsIProcess, public nsIObserver { bool aHoldWeak, bool aArgsUTF8); PRThread* mThread; - mozilla::Mutex mLock MOZ_UNANNOTATED; + mozilla::Mutex mLock; bool mShutdown; bool mBlocking; bool mStartHidden; diff --git a/xpcom/threads/nsThreadManager.cpp b/xpcom/threads/nsThreadManager.cpp index 3c5c7b6c5855..b7f78b15a0e7 100644 --- a/xpcom/threads/nsThreadManager.cpp +++ b/xpcom/threads/nsThreadManager.cpp @@ -66,7 +66,7 @@ class BackgroundEventTarget final : public nsIEventTarget { nsCOMPtr mPool; nsCOMPtr mIOPool; - Mutex mMutex MOZ_UNANNOTATED; + Mutex mMutex; nsTArray> mTaskQueues; bool mIsBackgroundDelayedRunnablesCanceled; }; diff --git a/xpcom/threads/nsThreadPool.h b/xpcom/threads/nsThreadPool.h index a8b8425bcdb9..7bdafde57c66 100644 --- a/xpcom/threads/nsThreadPool.h +++ b/xpcom/threads/nsThreadPool.h @@ -37,7 +37,7 @@ class nsThreadPool final : public mozilla::Runnable, public nsIThreadPool { nsresult PutEvent(already_AddRefed aEvent, uint32_t aFlags); nsCOMArray mThreads; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; mozilla::CondVar mEventsAvailable; mozilla::EventQueue mEvents; uint32_t mThreadLimit; diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index c89b8108d704..4e6c93181b67 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -56,7 +56,7 @@ class TimerThreadWrapper { uint32_t AllowedEarlyFiringMicroseconds(); private: - static mozilla::StaticMutex sMutex MOZ_UNANNOTATED; + static mozilla::StaticMutex sMutex; TimerThread* mThread; }; @@ -310,7 +310,7 @@ static mozilla::LogModule* GetTimerFiringsLog() { return sTimerFiringsLog; } #include /* static */ -mozilla::StaticMutex nsTimerImpl::sDeltaMutex MOZ_UNANNOTATED; +mozilla::StaticMutex nsTimerImpl::sDeltaMutex; /* static */ double nsTimerImpl::sDeltaSumSquared = 0; /* static */ diff --git a/xpcom/threads/nsTimerImpl.h b/xpcom/threads/nsTimerImpl.h index ecf7202fe186..a1f993cb8e0f 100644 --- a/xpcom/threads/nsTimerImpl.h +++ b/xpcom/threads/nsTimerImpl.h @@ -173,12 +173,12 @@ class nsTimerImpl { mozilla::TimeStamp mTimeout; RefPtr mITimer; - mozilla::Mutex mMutex MOZ_UNANNOTATED; + mozilla::Mutex mMutex; Callback mCallback; // Counter because in rare cases we can Fire reentrantly unsigned int mFiring; - static mozilla::StaticMutex sDeltaMutex MOZ_UNANNOTATED; + static mozilla::StaticMutex sDeltaMutex; static double sDeltaSum; static double sDeltaSumSquared; static double sDeltaNum; diff --git a/xpfe/appshell/AppWindow.h b/xpfe/appshell/AppWindow.h index ff2befb80bd8..8a9a2492123f 100644 --- a/xpfe/appshell/AppWindow.h +++ b/xpfe/appshell/AppWindow.h @@ -344,7 +344,7 @@ class AppWindow final : public nsIBaseWindow, nsCOMPtr mPrimaryBrowserParent; nsCOMPtr mSPTimer; - mozilla::Mutex mSPTimerLock MOZ_UNANNOTATED; + mozilla::Mutex mSPTimerLock; WidgetListenerDelegate mWidgetListenerDelegate; private: