From 4b033a52560258e72f8bf26759aff3a814b2e026 Mon Sep 17 00:00:00 2001
From: Randell Jesup <rjesup@wgate.com>
Date: Wed, 16 Mar 2022 16:16:14 +0000
Subject: [PATCH] Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors
 r=nika,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D140849
---
 accessible/ipc/win/HandlerProvider.h             |  4 ++--
 docshell/base/timeline/MarkersStorage.h          |  2 +-
 docshell/base/timeline/TimelineConsumers.h       |  2 +-
 dom/base/BodyStream.h                            |  2 +-
 dom/cache/Manager.cpp                            |  2 +-
 dom/cache/ReadStream.cpp                         |  2 +-
 dom/canvas/HostWebGLContext.cpp                  |  2 +-
 dom/canvas/ImageBitmap.cpp                       |  2 +-
 dom/canvas/OffscreenCanvasDisplayHelper.h        |  2 +-
 dom/console/ConsoleReportCollector.h             |  2 +-
 dom/file/FileBlobImpl.h                          |  2 +-
 dom/file/MemoryBlobImpl.h                        |  2 +-
 dom/file/MutableBlobStorage.h                    |  2 +-
 dom/file/ipc/RemoteLazyInputStream.h             |  2 +-
 dom/file/ipc/RemoteLazyInputStreamChild.h        |  2 +-
 dom/file/uri/BlobURLInputStream.h                |  2 +-
 dom/file/uri/BlobURLProtocolHandler.cpp          |  2 +-
 dom/filesystem/GetFilesHelper.h                  |  2 +-
 dom/gamepad/GamepadPlatformService.h             |  2 +-
 dom/indexedDB/ActorsParent.cpp                   |  8 ++++----
 dom/indexedDB/SchemaUpgrades.cpp                 |  2 +-
 dom/ipc/ProcessHangMonitor.cpp                   |  6 +++---
 dom/ipc/RefMessageBodyService.h                  |  2 +-
 dom/localstorage/ActorsParent.cpp                |  4 ++--
 dom/media/AudioStream.h                          |  2 +-
 dom/media/Benchmark.cpp                          |  2 +-
 dom/media/ChannelMediaResource.h                 |  2 +-
 dom/media/CloneableWithRangeMediaResource.cpp    |  2 +-
 dom/media/FileBlockCache.h                       |  4 ++--
 dom/media/FileMediaResource.h                    |  2 +-
 dom/media/FrameStatistics.h                      |  2 +-
 dom/media/GraphDriver.h                          |  2 +-
 dom/media/GraphRunner.h                          |  2 +-
 dom/media/MediaCache.cpp                         |  2 +-
 dom/media/MediaEventSource.h                     |  2 +-
 dom/media/MediaFormatReader.cpp                  |  2 +-
 dom/media/MediaFormatReader.h                    |  2 +-
 dom/media/MediaManager.h                         |  2 +-
 dom/media/MediaQueue.h                           |  2 +-
 dom/media/MediaTimer.h                           |  2 +-
 dom/media/MediaTrackGraph.h                      |  2 +-
 dom/media/MediaTrackGraphImpl.h                  |  2 +-
 dom/media/MemoryBlockCache.h                     |  2 +-
 dom/media/VideoFrameContainer.h                  |  2 +-
 dom/media/VideoOutput.h                          |  2 +-
 dom/media/doctor/DDMediaLogs.h                   |  2 +-
 dom/media/doctor/MultiWriterQueue.h              |  2 +-
 .../doctor/test/gtest/TestMultiWriterQueue.cpp   |  2 +-
 dom/media/gmp/ChromiumCDMProxy.h                 |  2 +-
 dom/media/gmp/GMPPlatform.cpp                    |  6 +++---
 dom/media/gmp/GMPService.h                       |  5 +++--
 dom/media/gmp/GMPServiceParent.h                 |  2 +-
 dom/media/gmp/GMPStorageChild.h                  |  2 +-
 dom/media/gtest/MockCubeb.h                      |  2 +-
 dom/media/gtest/TestCDMStorage.cpp               |  2 +-
 dom/media/gtest/TestWebMBuffered.cpp             |  6 +++---
 dom/media/hls/HLSDecoder.cpp                     |  2 +-
 dom/media/hls/HLSDemuxer.cpp                     |  2 +-
 dom/media/hls/HLSDemuxer.h                       |  2 +-
 dom/media/mediasource/ContainerParser.cpp        |  6 +++---
 dom/media/mediasource/MediaSourceDemuxer.h       |  4 ++--
 dom/media/mediasource/TrackBuffersManager.h      |  2 +-
 dom/media/ogg/OggCodecStore.h                    |  2 +-
 dom/media/platforms/AllocationPolicy.h           |  4 ++--
 dom/media/platforms/PDMFactory.cpp               |  2 +-
 dom/media/platforms/SimpleMap.h                  |  2 +-
 .../agnostic/eme/SamplesWaitingForKey.h          |  2 +-
 dom/media/platforms/apple/AppleVTDecoder.h       |  2 +-
 dom/media/platforms/ffmpeg/FFmpegDataDecoder.h   |  5 +++--
 .../platforms/ffmpeg/FFmpegVideoFramePool.h      |  2 +-
 dom/media/platforms/wmf/DXVA2Manager.cpp         |  2 +-
 dom/media/platforms/wmf/DXVA2Manager.h           |  2 +-
 dom/media/platforms/wmf/WMFDecoderModule.cpp     |  2 +-
 dom/media/systemservices/CamerasChild.h          |  6 +++---
 .../MediaSystemResourceManager.cpp               |  5 +++--
 .../systemservices/MediaSystemResourceManager.h  |  2 +-
 dom/media/systemservices/MediaUtils.h            |  6 +++---
 dom/media/systemservices/OSXRunLoopSingleton.cpp |  2 +-
 dom/media/systemservices/OpenSLESProvider.h      |  2 +-
 dom/media/systemservices/ShmemPool.h             |  2 +-
 .../systemservices/video_engine/tab_capturer.h   |  2 +-
 dom/media/webaudio/AudioBuffer.cpp               |  2 +-
 dom/media/webaudio/ScriptProcessorNode.cpp       |  2 +-
 dom/media/webaudio/blink/HRTFDatabaseLoader.h    |  2 +-
 dom/media/webaudio/blink/ReverbConvolver.h       |  2 +-
 dom/media/webm/WebMBufferedParser.h              |  2 +-
 dom/media/webrtc/CubebDeviceEnumerator.cpp       |  2 +-
 dom/media/webrtc/CubebDeviceEnumerator.h         |  2 +-
 dom/media/webrtc/MediaEngineRemoteVideoSource.h  |  2 +-
 dom/media/webrtc/libwebrtcglue/AudioConduit.h    |  2 +-
 dom/media/webrtc/libwebrtcglue/VideoConduit.h    |  4 ++--
 .../webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h   |  4 ++--
 .../libwebrtcglue/WebrtcMediaDataEncoderCodec.h  |  2 +-
 dom/media/webrtc/transport/nr_socket_prsock.h    |  2 +-
 .../webrtc/transportbridge/MediaPipeline.cpp     |  2 +-
 dom/midi/MIDIMessageQueue.h                      |  2 +-
 dom/midi/MIDIPlatformService.h                   |  2 +-
 dom/midi/midirMIDIPlatformService.h              |  2 +-
 dom/performance/PerformanceService.cpp           |  2 +-
 dom/performance/PerformanceStorageWorker.h       |  2 +-
 dom/promise/PromiseWorkerProxy.h                 |  2 +-
 dom/quota/QuotaManager.h                         |  2 +-
 dom/serviceworkers/ServiceWorkerRegistrar.h      |  2 +-
 dom/storage/LocalStorageCache.h                  |  2 +-
 dom/storage/StorageDBThread.cpp                  |  2 +-
 dom/storage/StorageDBThread.h                    |  2 +-
 dom/storage/StorageIPC.cpp                       |  2 +-
 dom/webauthn/U2FHIDTokenManager.cpp              |  2 +-
 dom/webauthn/U2FTokenManager.cpp                 |  2 +-
 dom/webbrowserpersist/nsWebBrowserPersist.cpp    |  2 +-
 dom/webbrowserpersist/nsWebBrowserPersist.h      |  2 +-
 dom/webgpu/ipc/WebGPUParent.cpp                  |  2 +-
 dom/websocket/WebSocket.cpp                      |  2 +-
 dom/websocket/WebSocket.h                        |  2 +-
 dom/workers/Queue.h                              |  2 +-
 dom/workers/RuntimeService.cpp                   |  2 +-
 dom/workers/RuntimeService.h                     |  2 +-
 dom/workers/WorkerCSPEventListener.h             |  2 +-
 dom/workers/WorkerDebuggerManager.h              |  2 +-
 dom/workers/WorkerDocumentListener.h             |  2 +-
 dom/workers/WorkerEventTarget.h                  |  2 +-
 dom/workers/WorkerPrivate.cpp                    |  2 +-
 dom/workers/WorkerThread.h                       |  2 +-
 dom/xhr/XMLHttpRequestMainThread.h               |  2 +-
 dom/xhr/XMLHttpRequestString.cpp                 |  2 +-
 extensions/permissions/PermissionManager.h       |  4 ++--
 .../spellcheck/src/mozPersonalDictionary.h       |  4 ++--
 gfx/2d/2D.h                                      |  8 ++++----
 gfx/2d/DrawTargetSkia.h                          |  2 +-
 gfx/2d/NativeFontResourceDWrite.cpp              |  2 +-
 gfx/2d/SourceSurfaceSkia.h                       |  2 +-
 gfx/gl/AndroidSurfaceTexture.cpp                 |  2 +-
 gfx/gl/GLContextProviderEGL.cpp                  |  2 +-
 gfx/gl/SharedSurface.h                           |  2 +-
 gfx/gl/SharedSurfaceEGL.h                        |  2 +-
 gfx/layers/AndroidHardwareBuffer.h               |  2 +-
 gfx/layers/CompositorAnimationStorage.h          |  2 +-
 gfx/layers/DMABUFSurfaceImage.cpp                |  2 +-
 gfx/layers/ImageContainer.h                      |  6 +++---
 gfx/layers/NativeLayerCA.h                       |  4 ++--
 gfx/layers/NativeLayerWayland.h                  |  4 ++--
 gfx/layers/ProfilerScreenshots.h                 |  2 +-
 gfx/layers/SourceSurfaceSharedData.h             |  2 +-
 gfx/layers/SurfacePoolWayland.h                  |  2 +-
 gfx/layers/apz/public/APZSampler.h               |  6 +++---
 gfx/layers/apz/public/APZUpdater.h               |  6 +++---
 gfx/layers/apz/src/APZCTreeManager.h             |  8 ++++----
 gfx/layers/apz/src/AsyncPanZoomController.h      |  6 +++---
 gfx/layers/apz/src/CheckerboardEvent.h           |  2 +-
 gfx/layers/apz/src/FocusState.h                  |  2 +-
 gfx/layers/apz/util/APZThreadUtils.cpp           |  2 +-
 gfx/layers/client/TextureClient.cpp              |  2 +-
 .../client/TextureClientRecycleAllocator.h       |  2 +-
 gfx/layers/d3d11/TextureD3D11.h                  |  2 +-
 gfx/layers/ipc/CompositableInProcessManager.h    |  2 +-
 gfx/layers/ipc/CompositorBridgeParent.h          |  4 ++--
 gfx/layers/ipc/CompositorManagerParent.h         |  2 +-
 gfx/layers/ipc/CompositorVsyncScheduler.h        |  6 +++---
 gfx/layers/ipc/ImageBridgeChild.cpp              |  2 +-
 gfx/layers/ipc/ImageBridgeChild.h                |  2 +-
 gfx/layers/ipc/LayerTreeOwnerTracker.h           |  2 +-
 gfx/layers/ipc/SharedSurfacesParent.h            |  2 +-
 gfx/layers/ipc/SynchronousTask.h                 |  2 +-
 gfx/layers/wr/AsyncImagePipelineManager.h        |  2 +-
 gfx/layers/wr/OMTASampler.h                      |  8 ++++----
 gfx/src/gfxCrashReporterUtils.cpp                |  2 +-
 gfx/tests/gtest/TestVsync.cpp                    |  2 +-
 gfx/thebes/DeviceManagerDx.h                     |  2 +-
 gfx/thebes/VsyncSource.h                         |  2 +-
 gfx/thebes/gfxDWriteCommon.cpp                   |  2 +-
 gfx/thebes/gfxPlatform.cpp                       |  2 +-
 gfx/thebes/gfxPlatformFontList.h                 |  2 +-
 gfx/thebes/gfxPlatformGtk.cpp                    |  4 ++--
 gfx/vr/VRManager.h                               |  2 +-
 gfx/vr/VRPuppetCommandBuffer.h                   |  2 +-
 gfx/vr/service/OpenVRSession.h                   |  2 +-
 gfx/webrender_bindings/RenderThread.h            |  2 +-
 image/AnimationSurfaceProvider.h                 |  4 ++--
 image/DecodePool.h                               |  2 +-
 image/DecodedSurfaceProvider.h                   |  2 +-
 image/IDecodingTask.h                            |  2 +-
 image/ProgressTracker.h                          |  2 +-
 image/SourceBuffer.h                             |  2 +-
 image/SurfaceCache.cpp                           |  2 +-
 image/encoders/jpeg/nsJPEGEncoder.h              |  2 +-
 image/encoders/png/nsPNGEncoder.h                |  2 +-
 image/encoders/webp/nsWebPEncoder.h              |  2 +-
 image/imgFrame.h                                 |  2 +-
 image/imgLoader.h                                |  2 +-
 image/imgRequest.h                               |  2 +-
 intl/strres/nsStringBundle.cpp                   |  2 +-
 intl/strres/nsStringBundle.h                     |  2 +-
 ipc/chromium/gtest/ports_unittest.cc             |  6 +++---
 ipc/chromium/src/base/at_exit.h                  |  2 +-
 ipc/chromium/src/base/message_loop.cc            |  2 +-
 ipc/chromium/src/base/message_loop.h             |  2 +-
 ipc/chromium/src/base/time_win.cc                |  2 +-
 ipc/chromium/src/mojo/core/ports/node.h          |  2 +-
 ipc/chromium/src/mojo/core/ports/port.h          |  2 +-
 ipc/glue/BrowserProcessSubThread.h               |  2 +-
 ipc/glue/CrashReporterClient.h                   |  2 +-
 ipc/glue/GeckoChildProcessHost.cpp               |  2 +-
 ipc/glue/GeckoChildProcessHost.h                 |  4 ++--
 ipc/glue/IPCStreamDestination.cpp                |  2 +-
 ipc/glue/MessageChannel.cpp                      |  2 +-
 ipc/glue/MessagePump.h                           |  2 +-
 ipc/ipdl/test/cxx/TestCrashCleanup.cpp           |  2 +-
 ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp  |  2 +-
 ipc/mscom/Interceptor.cpp                        |  2 +-
 ipc/mscom/Interceptor.h                          |  6 ++++--
 ipc/mscom/InterceptorLog.cpp                     |  2 +-
 js/src/ds/MemoryProtectionExceptionHandler.cpp   |  2 +-
 js/src/gc/GCRuntime.h                            |  2 +-
 js/src/gc/Scheduling.h                           |  2 +-
 js/src/gc/StoreBuffer.h                          |  2 +-
 js/src/jit/CacheIRSpewer.h                       |  2 +-
 js/src/jit/JitSpewer.cpp                         |  2 +-
 js/src/jit/ProcessExecutableMemory.cpp           |  2 +-
 js/src/jit/arm/Simulator-arm.h                   |  2 +-
 js/src/jit/arm64/vixl/Simulator-vixl.h           |  2 +-
 js/src/jit/mips32/Simulator-mips32.h             |  2 +-
 js/src/jit/mips64/Simulator-mips64.h             |  2 +-
 js/src/jsapi-tests/testCompileNonSyntactic.cpp   |  2 +-
 .../jsapi-tests/testScriptSourceCompression.cpp  |  2 +-
 js/src/jsapi-tests/testStencil.cpp               | 16 ++++++++--------
 .../testThreadingConditionVariable.cpp           |  2 +-
 js/src/jsapi-tests/testThreadingMutex.cpp        |  6 +++---
 js/src/shell/jsshell.h                           |  4 ++--
 js/src/threading/ExclusiveData.h                 |  4 ++--
 js/src/threading/Thread.h                        |  2 +-
 js/src/vm/HelperThreads.h                        |  2 +-
 js/src/vm/Monitor.h                              |  2 +-
 js/src/vm/Runtime.h                              |  2 +-
 js/src/vm/SharedArrayObject.h                    |  2 +-
 js/src/vm/TraceLogging.h                         |  2 +-
 js/src/vm/TraceLoggingGraph.h                    |  2 +-
 js/src/wasm/WasmProcess.cpp                      |  2 +-
 js/xpconnect/loader/ScriptPreloader.h            |  4 ++--
 js/xpconnect/loader/URLPreloader.h               |  2 +-
 js/xpconnect/src/XPCJSRuntime.cpp                |  2 +-
 .../signaling/gtest/mediapipeline_unittest.cpp   |  2 +-
 memory/build/Mutex.h                             |  8 ++++++++
 memory/build/mozjemalloc.cpp                     | 14 +++++++-------
 memory/replace/logalloc/LogAlloc.cpp             |  2 +-
 memory/replace/phc/PHC.cpp                       |  2 +-
 memory/volatile/VolatileBuffer.h                 |  2 +-
 mfbt/Attributes.h                                | 16 ++++++++++++++++
 modules/libjar/nsJAR.h                           |  2 +-
 modules/libjar/nsZipArchive.cpp                  |  2 +-
 modules/libpref/Preferences.cpp                  |  4 ++--
 mozglue/misc/AutoProfilerLabel.cpp               |  2 +-
 mozglue/misc/PlatformMutex.h                     |  1 -
 netwerk/base/AutoClose.h                         |  2 +-
 netwerk/base/BackgroundFileSaver.h               |  2 +-
 netwerk/base/Dashboard.h                         |  2 +-
 netwerk/base/IOActivityMonitor.h                 |  2 +-
 netwerk/base/NetworkConnectivityService.h        |  2 +-
 netwerk/base/PartiallySeekableInputStream.h      |  2 +-
 netwerk/base/ProxyAutoConfig.cpp                 |  2 +-
 netwerk/base/RedirectChannelRegistrar.h          |  2 +-
 netwerk/base/SSLTokensCache.h                    |  2 +-
 netwerk/base/TLSServerSocket.h                   |  2 +-
 netwerk/base/Tickler.h                           |  2 +-
 netwerk/base/nsAsyncStreamCopier.h               |  2 +-
 netwerk/base/nsBufferedStreams.h                 |  2 +-
 netwerk/base/nsIOService.h                       |  2 +-
 netwerk/base/nsInputStreamPump.h                 |  2 +-
 netwerk/base/nsMIMEInputStream.cpp               |  2 +-
 netwerk/base/nsNetUtil.cpp                       |  2 +-
 netwerk/base/nsProtocolProxyService.cpp          |  2 +-
 netwerk/base/nsServerSocket.h                    |  2 +-
 netwerk/base/nsSocketTransport2.h                |  2 +-
 netwerk/base/nsSocketTransportService2.h         |  2 +-
 netwerk/base/nsStandardURL.cpp                   |  2 +-
 netwerk/base/nsStreamTransportService.cpp        |  2 +-
 netwerk/base/nsStreamTransportService.h          |  3 ++-
 netwerk/base/nsTransportUtils.cpp                |  2 +-
 netwerk/base/nsUDPSocket.h                       |  2 +-
 netwerk/cache/nsCacheUtils.h                     |  2 +-
 netwerk/cache2/CacheEntry.h                      |  2 +-
 netwerk/cache2/CacheFileIOManager.cpp            |  4 ++--
 netwerk/cache2/CacheFileUtils.h                  |  6 +++---
 netwerk/cache2/CacheIOThread.h                   |  2 +-
 netwerk/cache2/CacheIndex.h                      |  2 +-
 netwerk/cache2/CacheStorageService.h             |  4 ++--
 netwerk/cookie/CookiePersistentStorage.h         |  2 +-
 netwerk/dns/ChildDNSService.h                    |  2 +-
 netwerk/dns/GetAddrInfo.h                        |  2 +-
 netwerk/dns/ODoHService.h                        |  2 +-
 netwerk/dns/TRRQuery.h                           |  3 ++-
 netwerk/dns/TRRService.h                         |  2 +-
 netwerk/dns/nsDNSService2.h                      |  2 +-
 netwerk/dns/nsEffectiveTLDService.h              |  2 +-
 netwerk/dns/nsHostRecord.h                       |  4 ++--
 netwerk/dns/nsHostResolver.h                     |  2 +-
 netwerk/dns/nsIDNService.h                       |  2 +-
 netwerk/ipc/ChannelEventQueue.h                  |  4 ++--
 netwerk/ipc/SocketProcessChild.h                 |  2 +-
 netwerk/protocol/gio/nsGIOProtocolHandler.cpp    |  3 ++-
 .../protocol/http/HttpBackgroundChannelParent.h  |  2 +-
 netwerk/protocol/http/HttpChannelChild.h         |  4 ++--
 netwerk/protocol/http/HttpConnectionBase.h       |  2 +-
 netwerk/protocol/http/HttpConnectionMgrParent.h  |  2 +-
 netwerk/protocol/http/HttpTransactionParent.h    |  3 ++-
 netwerk/protocol/http/nsCORSListenerProxy.h      |  2 +-
 .../protocol/http/nsHttpActivityDistributor.h    |  2 +-
 netwerk/protocol/http/nsHttpChannel.h            |  2 +-
 netwerk/protocol/http/nsHttpConnectionMgr.h      |  3 ++-
 netwerk/protocol/http/nsHttpHandler.h            |  2 +-
 netwerk/protocol/http/nsHttpRequestHead.h        |  3 ++-
 netwerk/protocol/http/nsHttpResponseHead.h       |  3 ++-
 netwerk/protocol/http/nsHttpTransaction.h        |  2 +-
 .../protocol/res/SubstitutingProtocolHandler.h   |  2 +-
 netwerk/protocol/websocket/WebSocketChannel.cpp  |  2 +-
 netwerk/protocol/websocket/WebSocketChannel.h    |  2 +-
 .../protocol/websocket/WebSocketChannelChild.h   |  2 +-
 .../websocket/WebSocketConnectionParent.h        |  2 +-
 netwerk/sctp/datachannel/DataChannel.cpp         |  2 +-
 netwerk/sctp/datachannel/DataChannel.h           |  6 +++---
 netwerk/socket/nsNamedPipeService.h              |  2 +-
 .../streamconv/converters/nsHTTPCompressConv.h   |  2 +-
 netwerk/streamconv/converters/nsUnknownDecoder.h |  2 +-
 netwerk/system/mac/nsNetworkLinkService.h        |  2 +-
 netwerk/system/netlink/NetlinkService.h          |  2 +-
 netwerk/system/win32/nsNotifyAddrListener.h      |  2 +-
 netwerk/test/gtest/TestNamedPipeService.cpp      |  2 +-
 netwerk/wifi/nsWifiMonitor.h                     |  2 +-
 parser/html/nsHtml5StreamListener.h              |  2 +-
 parser/html/nsHtml5StreamParser.h                |  6 +++---
 parser/html/nsHtml5TreeOpStage.h                 |  2 +-
 security/certverifier/OCSPCache.h                |  2 +-
 security/manager/ssl/DataStorage.h               |  6 ++++--
 security/manager/ssl/PSMRunnable.h               |  2 +-
 security/manager/ssl/SharedSSLState.h            |  2 +-
 security/manager/ssl/TransportSecurityInfo.h     |  4 ++--
 security/manager/ssl/nsCertOverrideService.h     |  2 +-
 security/manager/ssl/nsNSSCallbacks.cpp          |  2 +-
 security/manager/ssl/nsNSSComponent.cpp          |  2 +-
 security/manager/ssl/nsNSSComponent.h            |  4 ++--
 security/manager/ssl/nsNSSIOLayer.h              |  2 +-
 security/manager/ssl/nsProtectedAuthThread.h     |  2 +-
 .../sandbox/common/test/SandboxTestingParent.h   |  2 +-
 .../sandbox/linux/reporter/SandboxReporter.cpp   |  2 +-
 .../sandbox/linux/reporter/SandboxReporter.h     |  2 +-
 startupcache/StartupCache.h                      |  2 +-
 storage/mozStorageConnection.cpp                 |  2 +-
 storage/mozStorageConnection.h                   |  2 +-
 storage/mozStorageService.h                      |  4 ++--
 storage/test/gtest/storage_test_harness.h        |  2 +-
 storage/test/gtest/test_unlock_notify.cpp        |  2 +-
 .../BackgroundHangMonitor.cpp                    |  2 +-
 .../backgroundhangmonitor/HangAnnotations.h      |  2 +-
 .../webidl-api/ExtensionEventListener.h          |  2 +-
 .../extensions/webrequest/StreamFilterParent.h   |  2 +-
 toolkit/components/places/History.h              |  4 ++--
 toolkit/components/telemetry/core/Telemetry.cpp  |  2 +-
 .../components/telemetry/core/TelemetryEvent.cpp |  2 +-
 .../telemetry/core/TelemetryHistogram.cpp        |  2 +-
 .../telemetry/core/TelemetryOrigin.cpp           |  2 +-
 .../telemetry/core/TelemetryScalar.cpp           |  2 +-
 .../core/ipc/TelemetryIPCAccumulator.cpp         |  2 +-
 .../streaming/GeckoViewStreamingTelemetry.cpp    |  2 +-
 .../url-classifier/VariableLengthPrefixSet.h     |  2 +-
 .../url-classifier/nsUrlClassifierDBService.h    |  2 +-
 .../url-classifier/nsUrlClassifierPrefixSet.h    |  2 +-
 .../url-classifier/nsUrlClassifierUtils.h        |  2 +-
 toolkit/components/viaduct/ViaductRequest.h      |  2 +-
 .../components/windowwatcher/nsWindowWatcher.h   |  2 +-
 toolkit/crashreporter/nsExceptionHandler.cpp     |  2 +-
 .../xre/dllservices/UntrustedModulesProcessor.h  |  4 ++--
 toolkit/xre/nsUpdateDriver.cpp                   |  2 +-
 tools/performance/PerfStats.h                    |  2 +-
 tools/profiler/core/memory_hooks.cpp             |  2 +-
 tools/profiler/core/platform.cpp                 |  3 ++-
 tools/profiler/core/shared-libraries-macos.cc    |  2 +-
 widget/GfxInfoBase.h                             |  2 +-
 widget/VsyncDispatcher.h                         |  2 +-
 widget/android/EventDispatcher.h                 |  2 +-
 widget/android/jni/Natives.h                     |  2 +-
 widget/android/nsAppShell.h                      |  2 +-
 widget/cocoa/nsChildView.h                       |  2 +-
 widget/cocoa/nsCocoaUtils.h                      |  2 +-
 widget/gtk/DMABufLibWrapper.cpp                  |  2 +-
 widget/gtk/DMABufLibWrapper.h                    |  2 +-
 widget/gtk/DMABufSurface.h                       |  2 +-
 widget/gtk/WaylandVsyncSource.h                  |  2 +-
 widget/gtk/WindowSurfaceProvider.h               |  2 +-
 widget/gtk/WindowSurfaceWaylandMultiBuffer.h     |  2 +-
 widget/gtk/nsWaylandDisplay.cpp                  |  2 +-
 widget/windows/AudioSession.cpp                  |  2 +-
 widget/windows/InProcessWinCompositorWidget.h    |  2 +-
 widget/windows/JumpListBuilder.h                 |  2 +-
 widget/windows/nsAppShell.h                      |  2 +-
 widget/windows/nsPrinterWin.h                    |  2 +-
 xpcom/base/AvailableMemoryWatcherLinux.cpp       |  2 +-
 xpcom/base/AvailableMemoryWatcherWin.cpp         |  2 +-
 xpcom/base/RLBoxSandboxPool.h                    |  2 +-
 xpcom/base/nsConsoleService.h                    |  2 +-
 xpcom/base/nsDumpUtils.h                         |  4 ++--
 xpcom/base/nsMacUtilsImpl.h                      |  2 +-
 xpcom/base/nsMemoryReporterManager.h             |  2 +-
 xpcom/build/IOInterposer.cpp                     |  2 +-
 xpcom/build/MainThreadIOLogger.cpp               |  2 +-
 xpcom/components/nsCategoryManager.h             |  4 ++--
 xpcom/components/nsComponentManager.h            |  2 +-
 xpcom/ds/nsAtomTable.cpp                         |  2 +-
 xpcom/io/FilePreferences.cpp                     |  2 +-
 xpcom/io/InputStreamLengthWrapper.h              |  2 +-
 xpcom/io/NonBlockingAsyncInputStream.h           |  2 +-
 xpcom/io/SeekableStreamWrapper.h                 |  2 +-
 xpcom/io/SlicedInputStream.h                     |  2 +-
 xpcom/io/nsMultiplexInputStream.cpp              |  2 +-
 xpcom/io/nsPipe3.cpp                             |  2 +-
 xpcom/io/nsStreamUtils.cpp                       |  2 +-
 xpcom/io/nsStringStream.cpp                      |  2 +-
 xpcom/rust/gtest/bench-collections/Bench.cpp     |  2 +-
 xpcom/tests/gtest/TestDeadlockDetector.cpp       |  4 ++--
 xpcom/tests/gtest/TestDelayedRunnable.cpp        |  4 ++--
 xpcom/tests/gtest/TestRWLock.cpp                 | 10 +++++-----
 xpcom/tests/gtest/TestSynchronization.cpp        | 12 ++++++------
 xpcom/tests/gtest/TestTaskQueue.cpp              |  2 +-
 xpcom/tests/gtest/TestThreadPool.cpp             |  2 +-
 xpcom/tests/gtest/TestThrottledEventQueue.cpp    |  6 +++---
 xpcom/tests/gtest/TestTimers.cpp                 |  2 +-
 xpcom/threads/BlockingResourceBase.h             |  1 +
 xpcom/threads/LazyIdleThread.h                   |  2 +-
 xpcom/threads/MozPromise.h                       |  2 +-
 xpcom/threads/SpinEventLoopUntil.h               |  2 +-
 xpcom/threads/SyncRunnable.h                     |  2 +-
 xpcom/threads/TaskController.h                   |  4 ++--
 xpcom/threads/TaskQueue.h                        |  2 +-
 xpcom/threads/ThreadEventQueue.h                 |  2 +-
 xpcom/threads/ThrottledEventQueue.cpp            |  2 +-
 xpcom/threads/TimerThread.cpp                    |  2 +-
 xpcom/threads/TimerThread.h                      |  2 +-
 xpcom/threads/nsEnvironment.h                    |  2 +-
 xpcom/threads/nsProcess.h                        |  2 +-
 xpcom/threads/nsThreadManager.cpp                |  2 +-
 xpcom/threads/nsThreadPool.h                     |  2 +-
 xpcom/threads/nsTimerImpl.cpp                    |  4 ++--
 xpcom/threads/nsTimerImpl.h                      |  4 ++--
 xpfe/appshell/AppWindow.h                        |  2 +-
 442 files changed, 587 insertions(+), 548 deletions(-)

diff --git a/accessible/ipc/win/HandlerProvider.h b/accessible/ipc/win/HandlerProvider.h
index bfaa58667d333..f517a0f9919c1 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<uint32_t> mRefCnt;
-  Mutex mMutex;  // Protects mSerializer
+  Mutex mMutex MOZ_UNANNOTATED;  // Protects mSerializer
   const IID mTargetUnkIid;
   mscom::InterceptorTargetPtr<IUnknown>
       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;  // Protects mPayload
+  Mutex mPayloadMutex MOZ_UNANNOTATED;  // Protects mPayload
 };
 
 }  // namespace a11y
diff --git a/docshell/base/timeline/MarkersStorage.h b/docshell/base/timeline/MarkersStorage.h
index 746a02e4ec422..ee401bdcabcd2 100644
--- a/docshell/base/timeline/MarkersStorage.h
+++ b/docshell/base/timeline/MarkersStorage.h
@@ -40,7 +40,7 @@ class MarkersStorage : public LinkedListElement<MarkersStorage> {
   Mutex& GetLock();
 
  private:
-  Mutex mLock;
+  Mutex mLock MOZ_UNANNOTATED;
 };
 
 }  // namespace mozilla
diff --git a/docshell/base/timeline/TimelineConsumers.h b/docshell/base/timeline/TimelineConsumers.h
index 8ce9953562438..7b2b6669c2440 100644
--- a/docshell/base/timeline/TimelineConsumers.h
+++ b/docshell/base/timeline/TimelineConsumers.h
@@ -123,7 +123,7 @@ class TimelineConsumers : public nsIObserver {
   LinkedList<MarkersStorage> mMarkersStores;
 
   // Protects this class's data structures.
-  static StaticMutex sMutex;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace mozilla
diff --git a/dom/base/BodyStream.h b/dom/base/BodyStream.h
index 80918bdce5721..6328617b3efdc 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // Protected by mutex.
   State mState;
diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp
index 366f491812883..04216b89fe793 100644
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -1101,7 +1101,7 @@ class Manager::CachePutAllAction final : public DBAction {
   nsTArray<nsID> mDeletedBodyIdList;
 
   // accessed from any thread while mMutex locked
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   nsTArray<nsCOMPtr<nsISupports>> mCopyContextList;
 
   Maybe<CacheDirectoryMetadata> mDirectoryMetadata;
diff --git a/dom/cache/ReadStream.cpp b/dom/cache/ReadStream.cpp
index 3de6561d341e8..478d791ccd63a 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   CondVar mCondVar;
   nsCOMPtr<nsIInputStream> mStream;
   nsCOMPtr<nsIInputStream> mSnappyStream;
diff --git a/dom/canvas/HostWebGLContext.cpp b/dom/canvas/HostWebGLContext.cpp
index 9d0b47d9a03e8..36029e33ed555 100644
--- a/dom/canvas/HostWebGLContext.cpp
+++ b/dom/canvas/HostWebGLContext.cpp
@@ -32,7 +32,7 @@ namespace mozilla {
 
 // -
 
-static StaticMutex sContextSetLock;
+static StaticMutex sContextSetLock MOZ_UNANNOTATED;
 
 static std::unordered_set<HostWebGLContext*>& DeferredStaticContextSet() {
   static std::unordered_set<HostWebGLContext*> sContextSet;
diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp
index acc7c19df5628..ff37dcdbacc39 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 a98396685c120..970f8c4be5d2b 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;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
   HTMLCanvasElement* MOZ_NON_OWNING_REF mCanvasElement;
   RefPtr<layers::ImageContainer> mImageContainer;
   RefPtr<gfx::SourceSurface> mFrontBufferSurface;
diff --git a/dom/console/ConsoleReportCollector.h b/dom/console/ConsoleReportCollector.h
index de8900c4e8801..fc82a65bda6a8 100644
--- a/dom/console/ConsoleReportCollector.h
+++ b/dom/console/ConsoleReportCollector.h
@@ -78,7 +78,7 @@ class ConsoleReportCollector final : public nsIConsoleReportCollector {
     const CopyableTArray<nsString> mStringParams;
   };
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // protected by mMutex
   nsTArray<PendingReport> mPendingReports;
diff --git a/dom/file/FileBlobImpl.h b/dom/file/FileBlobImpl.h
index 9f512d81333cc..7a031747fc73f 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   nsCOMPtr<nsIFile> mFile;
 
diff --git a/dom/file/MemoryBlobImpl.h b/dom/file/MemoryBlobImpl.h
index f1279e395c9e8..3bb9b7c7fcd91 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;
+    static mozilla::StaticMutex sDataOwnerMutex MOZ_UNANNOTATED;
     static mozilla::StaticAutoPtr<mozilla::LinkedList<DataOwner> > sDataOwners;
     static bool sMemoryReporterRegistered;
 
diff --git a/dom/file/MutableBlobStorage.h b/dom/file/MutableBlobStorage.h
index 6bacaa9de42e6..aa0d42c75ecd2 100644
--- a/dom/file/MutableBlobStorage.h
+++ b/dom/file/MutableBlobStorage.h
@@ -92,7 +92,7 @@ class MutableBlobStorage final {
   [[nodiscard]] nsresult DispatchToIOThread(
       already_AddRefed<nsIRunnable> aRunnable);
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 c36f63f4ab824..7044facc4e3b6 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace mozilla
diff --git a/dom/file/ipc/RemoteLazyInputStreamChild.h b/dom/file/ipc/RemoteLazyInputStreamChild.h
index 7e86a90ac85ae..a91c19c499a8c 100644
--- a/dom/file/ipc/RemoteLazyInputStreamChild.h
+++ b/dom/file/ipc/RemoteLazyInputStreamChild.h
@@ -78,7 +78,7 @@ class RemoteLazyInputStreamChild final : public PRemoteLazyInputStreamChild {
   nsTArray<RemoteLazyInputStream*> mStreams;
 
   // This mutex protects mStreams because that can be touched in any thread.
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   const nsID mID;
   const uint64_t mSize;
diff --git a/dom/file/uri/BlobURLInputStream.h b/dom/file/uri/BlobURLInputStream.h
index 98d104b2578e2..0ddf4fab5e5c1 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;
+  Mutex mStateMachineMutex MOZ_UNANNOTATED;
   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 a1bcead17bc3a..14f813b7d437a 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;
+static StaticMutex sMutex MOZ_UNANNOTATED;
 
 // 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 8591526be3a47..def05767192f7 100644
--- a/dom/filesystem/GetFilesHelper.h
+++ b/dom/filesystem/GetFilesHelper.h
@@ -118,7 +118,7 @@ class GetFilesHelper : public Runnable, public GetFilesHelperBase {
   nsTArray<RefPtr<Promise>> mPromises;
   nsTArray<RefPtr<GetFilesCallback>> mCallbacks;
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // This variable is protected by mutex.
   bool mCanceled;
diff --git a/dom/gamepad/GamepadPlatformService.h b/dom/gamepad/GamepadPlatformService.h
index 3d7a6a9b922c8..8679cce76d379 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   std::map<GamepadHandle, GamepadAdded> mGamepadAdded;
 };
diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp
index 4fee345d6593b..af677ab21a5c2 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;
+  Mutex mDatabasesMutex MOZ_UNANNOTATED;
 
   nsTArray<IdleThreadInfo> mIdleThreads;
   nsTArray<IdleDatabaseInfo> mIdleDatabases;
@@ -6592,7 +6592,7 @@ nsresult DispatchAndReturnFileReferences(
   *aMemRefCnt = -1;
   *aDBRefCnt = -1;
 
-  mozilla::Monitor monitor(__func__);
+  mozilla::Monitor monitor MOZ_ANNOTATED(__func__);
   bool waiting = true;
 
   auto lambda = [&] {
@@ -6758,7 +6758,7 @@ class DeserializeIndexValueHelper final : public Runnable {
     lock.Notify();
   }
 
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   const int64_t mIndexID;
   const KeyPath& mKeyPath;
@@ -21682,7 +21682,7 @@ class FileHelper::ReadCallback final : public nsIInputStreamCallback {
  private:
   ~ReadCallback() = default;
 
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   mozilla::CondVar mCondVar;
   bool mInputAvailable;
 };
diff --git a/dom/indexedDB/SchemaUpgrades.cpp b/dom/indexedDB/SchemaUpgrades.cpp
index f65c67dd8672a..5c749810b1bde 100644
--- a/dom/indexedDB/SchemaUpgrades.cpp
+++ b/dom/indexedDB/SchemaUpgrades.cpp
@@ -2842,7 +2842,7 @@ class DeserializeUpgradeValueHelper final : public Runnable {
     lock.Notify();
   }
 
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   StructuredCloneReadInfoParent& mCloneReadInfo;
   nsresult mStatus;
 };
diff --git a/dom/ipc/ProcessHangMonitor.cpp b/dom/ipc/ProcessHangMonitor.cpp
index 1f10dec122e0d..08d9abf377dfa 100644
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -148,7 +148,7 @@ class HangMonitorChild : public PProcessHangMonitorChild,
   static Atomic<HangMonitorChild*, SequentiallyConsistent> sInstance;
 
   const RefPtr<ProcessHangMonitor> mHangMonitor;
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   // 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   // Must be accessed with mMonitor held.
   RefPtr<HangMonitoredProcess> mProcess;
@@ -290,7 +290,7 @@ class HangMonitorParent : public PProcessHangMonitorParent,
   // Map from plugin ID to crash dump ID. Protected by
   // mBrowserCrashDumpHashLock.
   nsTHashMap<nsUint32HashKey, nsString> mBrowserCrashDumpIds;
-  Mutex mBrowserCrashDumpHashLock;
+  Mutex mBrowserCrashDumpHashLock MOZ_UNANNOTATED;
   mozilla::ipc::TaskFactory<HangMonitorParent> mMainThreadTaskFactory;
 };
 
diff --git a/dom/ipc/RefMessageBodyService.h b/dom/ipc/RefMessageBodyService.h
index ac4aff1722763..6cca2a836efa0 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   UniquePtr<ipc::StructuredCloneData> mCloneData;
 
diff --git a/dom/localstorage/ActorsParent.cpp b/dom/localstorage/ActorsParent.cpp
index 477a88c243854..d9ca5e6393f6b 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;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
   const OriginMetadata mOriginMetadata;
   nsString mOriginDirectoryPath;
   nsresult mIOThreadResultCode;
@@ -2614,7 +2614,7 @@ class QuotaClient final : public mozilla::dom::quota::Client {
 
   static QuotaClient* sInstance;
 
-  Mutex mShadowDatabaseMutex;
+  Mutex mShadowDatabaseMutex MOZ_UNANNOTATED;
   bool mShutdownRequested;
 
  public:
diff --git a/dom/media/AudioStream.h b/dom/media/AudioStream.h
index 01765e9f90f2e..964ff1c473060 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   const uint32_t mOutChannels;
   const AudioConfig::ChannelLayout::ChannelMap mChannelMap;
diff --git a/dom/media/Benchmark.cpp b/dom/media/Benchmark.cpp
index 14ab452129644..6b2af7a3a1000 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;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
   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 1de692ca89970..bd1b83b5a81ed 100644
--- a/dom/media/ChannelMediaResource.h
+++ b/dom/media/ChannelMediaResource.h
@@ -186,7 +186,7 @@ class ChannelMediaResource
     void Revoke();
 
    private:
-    Mutex mMutex;
+    Mutex mMutex MOZ_UNANNOTATED;
     // 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 c1facd86392ac..4faac6125fd4e 100644
--- a/dom/media/CloneableWithRangeMediaResource.cpp
+++ b/dom/media/CloneableWithRangeMediaResource.cpp
@@ -113,7 +113,7 @@ class InputStreamReader final : public nsIInputStreamCallback {
 
   nsCOMPtr<nsIInputStream> mStream;
   nsCOMPtr<nsIAsyncInputStream> mAsyncStream;
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
 };
 
 NS_IMPL_ADDREF(InputStreamReader);
diff --git a/dom/media/FileBlockCache.h b/dom/media/FileBlockCache.h
index 3108d603dfcb6..7773997e33aaf 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;
+  Mutex mFileMutex MOZ_UNANNOTATED;
   // 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;
+  Mutex mDataMutex MOZ_UNANNOTATED;
   // 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 d34f522ed8925..f1ebf5b948b93 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;
+  Mutex mLock MOZ_UNANNOTATED;
 
   // 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 ed0cd31229cee..6a85a412316f7 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;
+  mutable ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
 
   FrameStatisticsData mFrameStatisticsData;
 };
diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h
index 5f191de8967b9..7cd21ac8f3c75 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;
+    Monitor mMonitor MOZ_UNANNOTATED;
     // 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 8a5a60fb63063..1a8f879ef6aec 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
   // 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 62f10a4f613e1..41d51a49cc0f9 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;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
   // This must always be accessed when the monitor is held.
   nsTArray<MediaCacheStream*> mStreams;
   // The Blocks describing the cache entries.
diff --git a/dom/media/MediaEventSource.h b/dom/media/MediaEventSource.h
index 8115ffa7c936e..27198b11a22ba 100644
--- a/dom/media/MediaEventSource.h
+++ b/dom/media/MediaEventSource.h
@@ -475,7 +475,7 @@ class MediaEventSourceImpl {
   }
 
  private:
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   nsTArray<RefPtr<Listener>> mListeners;
 };
 
diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp
index 11ffd96c8fce2..f02c0e7c84e63 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   const RefPtr<TaskQueue> mTaskQueue;
   const bool mGetSamplesMayBlock;
   const UniquePtr<TrackInfo> mInfo;
diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h
index 912125cad2708..fc6a353316cb8 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;
+    Mutex mMutex MOZ_UNANNOTATED;
     // The platform decoder.
     RefPtr<MediaDataDecoder> mDecoder;
     nsCString mDescription;
diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h
index 2ca86203134ce..a3dba9ec2bb28 100644
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -391,7 +391,7 @@ class MediaManager final : public nsIMediaManagerService,
   RefPtr<MediaEngine> mBackend;
 
   static StaticRefPtr<MediaManager> sSingleton;
-  static StaticMutex sSingletonMutex;
+  static StaticMutex sSingletonMutex MOZ_UNANNOTATED;
 
   // Connect/Disconnect on media thread only
   MediaEventListener mDeviceListChangeListener;
diff --git a/dom/media/MediaQueue.h b/dom/media/MediaQueue.h
index 06f7c99df763b..3fd9049fb9f4f 100644
--- a/dom/media/MediaQueue.h
+++ b/dom/media/MediaQueue.h
@@ -179,7 +179,7 @@ class MediaQueue : private nsRefPtrDeque<T> {
     }
   }
 
-  mutable RecursiveMutex mRecursiveMutex;
+  mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED;
   MediaEventProducer<RefPtr<T>> mPopFrontEvent;
   MediaEventProducer<RefPtr<T>> mPushEvent;
   MediaEventProducer<void> mFinishEvent;
diff --git a/dom/media/MediaTimer.h b/dom/media/MediaTimer.h
index 3636c2cc9eba2..837a1591b3670 100644
--- a/dom/media/MediaTimer.h
+++ b/dom/media/MediaTimer.h
@@ -95,7 +95,7 @@ class MediaTimer {
 
   nsCOMPtr<nsIEventTarget> mThread;
   std::priority_queue<Entry> mEntries;
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   nsCOMPtr<nsITimer> mTimer;
   TimeStamp mCurrentTimerTarget;
 
diff --git a/dom/media/MediaTrackGraph.h b/dom/media/MediaTrackGraph.h
index 5b26bdda4c759..d9a76617a982b 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   // protected by mMutex
   float mVolume = 1.0;
   UniquePtr<TrackData> mUpdateTrack;
diff --git a/dom/media/MediaTrackGraphImpl.h b/dom/media/MediaTrackGraphImpl.h
index 1ce98709119b8..e523b52abbde8 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   // 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 abebb5125e727..32bf9615c6c84 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   nsTArray<uint8_t> mBuffer;
   bool mHasGrown = false;
diff --git a/dom/media/VideoFrameContainer.h b/dom/media/VideoFrameContainer.h
index 3b3621fdcf071..efa1ad8491cf9 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   // 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 14982caedd5d9..2eb81faa82fc6 100644
--- a/dom/media/VideoOutput.h
+++ b/dom/media/VideoOutput.h
@@ -213,7 +213,7 @@ class VideoOutput : public DirectMediaTrackListener {
     }
   }
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   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 059ccc3968d5b..ef5bbe98f901b 100644
--- a/dom/media/doctor/DDMediaLogs.h
+++ b/dom/media/doctor/DDMediaLogs.h
@@ -175,7 +175,7 @@ struct DDMediaLogs {
   nsTArray<DDObjectLink> mObjectLinks;
 
   // Protects members below.
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // Processing thread.
   nsCOMPtr<nsIThread> mThread;
diff --git a/dom/media/doctor/MultiWriterQueue.h b/dom/media/doctor/MultiWriterQueue.h
index 57ecc5d5ab9ef..82cc5c18b04e0 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 // 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 f189738ea4710..0c1ea6235c984 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   DequeWrapperMW() : mMutex("DequeWrapperMW/MT") {}
 
diff --git a/dom/media/gmp/ChromiumCDMProxy.h b/dom/media/gmp/ChromiumCDMProxy.h
index 28d0905380ec9..0f5c3f817f59e 100644
--- a/dom/media/gmp/ChromiumCDMProxy.h
+++ b/dom/media/gmp/ChromiumCDMProxy.h
@@ -131,7 +131,7 @@ class ChromiumCDMProxy : public CDMProxy {
 
   RefPtr<GMPCrashHelper> mCrashHelper;
 
-  Mutex mCDMMutex;
+  Mutex mCDMMutex MOZ_UNANNOTATED;
   RefPtr<gmp::ChromiumCDMParent> mCDM;
   nsCOMPtr<nsISerialEventTarget> mGMPThread;
   UniquePtr<ChromiumCDMCallbackProxy> mCallback;
diff --git a/dom/media/gmp/GMPPlatform.cpp b/dom/media/gmp/GMPPlatform.cpp
index 3075c43d54221..fa802006a8b29 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
 };
 
 class GMPThreadImpl : public GMPThread {
@@ -99,7 +99,7 @@ class GMPThreadImpl : public GMPThread {
   void Join() override;
 
  private:
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   base::Thread mThread;
 };
 
@@ -148,7 +148,7 @@ class GMPMutexImpl : public GMPMutex {
   void Destroy() override;
 
  private:
-  ReentrantMonitor mMonitor;
+  ReentrantMonitor mMonitor MOZ_UNANNOTATED;
 };
 
 GMPErr CreateMutex(GMPMutex** aMutex) {
diff --git a/dom/media/gmp/GMPService.h b/dom/media/gmp/GMPService.h
index ff9899669e334..33e7801e2a0e4 100644
--- a/dom/media/gmp/GMPService.h
+++ b/dom/media/gmp/GMPService.h
@@ -106,8 +106,9 @@ class GeckoMediaPluginService : public mozIGeckoMediaPluginService,
 
   static nsCOMPtr<nsIAsyncShutdownClient> GetShutdownBarrier();
 
-  Mutex mMutex;  // Protects mGMPThread, mPluginCrashHelpers,
-                 // mGMPThreadShutdown and some members in derived classes.
+  Mutex mMutex MOZ_UNANNOTATED;  // Protects mGMPThread, mPluginCrashHelpers,
+                                 // mGMPThreadShutdown and some members in
+                                 // derived classes.
 
   const nsCOMPtr<nsISerialEventTarget> mMainThread;
 
diff --git a/dom/media/gmp/GMPServiceParent.h b/dom/media/gmp/GMPServiceParent.h
index 7b0a556ba2c26..2ebcc020ee434 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;
+  Monitor mInitPromiseMonitor MOZ_UNANNOTATED;
   MozMonitoredPromiseHolder<GenericPromise> mInitPromise;
   bool mLoadPluginsFromDiskComplete;
 
diff --git a/dom/media/gmp/GMPStorageChild.h b/dom/media/gmp/GMPStorageChild.h
index cf6b30e53567c..5deecc991e260 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
   nsRefPtrHashtable<nsCStringHashKey, GMPRecordImpl> mRecords;
   GMPChild* mPlugin;
   bool mShutdown;
diff --git a/dom/media/gtest/MockCubeb.h b/dom/media/gtest/MockCubeb.h
index e3b3d47f4cd49..63ea90c7330b3 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;
+  Monitor mFrozenStartMonitor MOZ_UNANNOTATED;
   // 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 ab081b5b24c66..b4bc3644fb8b5 100644
--- a/dom/media/gtest/TestCDMStorage.cpp
+++ b/dom/media/gtest/TestCDMStorage.cpp
@@ -1150,7 +1150,7 @@ class CDMStorageTest {
   nsTArray<ExpectedMessage> mExpected;
 
   RefPtr<gmp::ChromiumCDMParent> mCDM;
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   Atomic<bool> mFinished;
   nsCString mNodeId;
 
diff --git a/dom/media/gtest/TestWebMBuffered.cpp b/dom/media/gtest/TestWebMBuffered.cpp
index 14f5ae2b25914..0da040371dd3f 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("dummy");
+  ReentrantMonitor dummy MOZ_UNANNOTATED("dummy");
   WebMBufferedParser parser(0);
 
   nsTArray<WebMTimeDataOffset> mapping;
@@ -60,7 +60,7 @@ static void ReadFile(const char* aPath, nsTArray<uint8_t>& aBuffer) {
 
 TEST(WebMBuffered, RealData)
 {
-  ReentrantMonitor dummy("dummy");
+  ReentrantMonitor dummy MOZ_UNANNOTATED("dummy");
   WebMBufferedParser parser(0);
 
   nsTArray<uint8_t> webmData;
@@ -82,7 +82,7 @@ TEST(WebMBuffered, RealData)
 
 TEST(WebMBuffered, RealDataAppend)
 {
-  ReentrantMonitor dummy("dummy");
+  ReentrantMonitor dummy MOZ_UNANNOTATED("dummy");
   WebMBufferedParser parser(0);
   nsTArray<WebMTimeDataOffset> mapping;
 
diff --git a/dom/media/hls/HLSDecoder.cpp b/dom/media/hls/HLSDecoder.cpp
index ebcdfb7d3a37f..792654f16c21e 100644
--- a/dom/media/hls/HLSDecoder.cpp
+++ b/dom/media/hls/HLSDecoder.cpp
@@ -44,7 +44,7 @@ class HLSResourceCallbacksSupport
 
  private:
   ~HLSResourceCallbacksSupport() {}
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   HLSDecoder* mDecoder;
 };
 
diff --git a/dom/media/hls/HLSDemuxer.cpp b/dom/media/hls/HLSDemuxer.cpp
index 24e79cbf11a6c..1827467b639c1 100644
--- a/dom/media/hls/HLSDemuxer.cpp
+++ b/dom/media/hls/HLSDemuxer.cpp
@@ -119,7 +119,7 @@ class HLSDemuxer::HLSDemuxerCallbacksSupport
     mDemuxer = nullptr;
   }
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
  private:
   ~HLSDemuxerCallbacksSupport() {}
diff --git a/dom/media/hls/HLSDemuxer.h b/dom/media/hls/HLSDemuxer.h
index 4813eaafb2be7..1a3e26c1f37bb 100644
--- a/dom/media/hls/HLSDemuxer.h
+++ b/dom/media/hls/HLSDemuxer.h
@@ -127,7 +127,7 @@ class HLSTrackDemuxer : public MediaTrackDemuxer,
   RefPtr<MediaRawData> mQueuedSample;
 
   // Mutex to protect members below across multiple threads.
-  mutable Mutex mMutex;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
   UniquePtr<TrackInfo> mTrackInfo;
 };
 
diff --git a/dom/media/mediasource/ContainerParser.cpp b/dom/media/mediasource/ContainerParser.cpp
index 1ce7d556b20e6..35a7cfaee7372 100644
--- a/dom/media/mediasource/ContainerParser.cpp
+++ b/dom/media/mediasource/ContainerParser.cpp
@@ -116,7 +116,7 @@ class WebMContainerParser
 
     WebMBufferedParser parser(0);
     nsTArray<WebMTimeDataOffset> mapping;
-    ReentrantMonitor dummy("dummy");
+    ReentrantMonitor dummy MOZ_ANNOTATED("dummy");
     bool result =
         parser.Append(aData.Elements(), aData.Length(), mapping, dummy);
     if (!result) {
@@ -134,7 +134,7 @@ class WebMContainerParser
 
     WebMBufferedParser parser(0);
     nsTArray<WebMTimeDataOffset> mapping;
-    ReentrantMonitor dummy("dummy");
+    ReentrantMonitor dummy MOZ_ANNOTATED("dummy");
     parser.AppendMediaSegmentOnly();
     bool result =
         parser.Append(aData.Elements(), aData.Length(), mapping, dummy);
@@ -182,7 +182,7 @@ class WebMContainerParser
     nsTArray<WebMTimeDataOffset> mapping;
     mapping.AppendElements(mOverlappedMapping);
     mOverlappedMapping.Clear();
-    ReentrantMonitor dummy("dummy");
+    ReentrantMonitor dummy MOZ_ANNOTATED("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 24decfe439538..332d7bb35d80c 100644
--- a/dom/media/mediasource/MediaSourceDemuxer.h
+++ b/dom/media/mediasource/MediaSourceDemuxer.h
@@ -83,7 +83,7 @@ class MediaSourceDemuxer : public MediaDataDemuxer,
   MozPromiseHolder<InitPromise> mInitPromise;
 
   // Monitor to protect members below across multiple threads.
-  mutable Monitor mMonitor;
+  mutable Monitor mMonitor MOZ_UNANNOTATED;
   RefPtr<TrackBuffersManager> mAudioTrack;
   RefPtr<TrackBuffersManager> mVideoTrack;
   MediaInfo mInfo;
@@ -138,7 +138,7 @@ class MediaSourceTrackDemuxer
   RefPtr<MediaSourceDemuxer> mParent;
   TrackInfo::TrackType mType;
   // Monitor protecting members below accessed from multiple threads.
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   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 77bae4483bc13..add157dac9ca1 100644
--- a/dom/media/mediasource/TrackBuffersManager.h
+++ b/dom/media/mediasource/TrackBuffersManager.h
@@ -514,7 +514,7 @@ class TrackBuffersManager final
   Atomic<EvictionState> mEvictionState;
 
   // Monitor to protect following objects accessed across multiple threads.
-  mutable Mutex mMutex;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
   // 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 b3246ffe0c95d..bcde8bed00892 100644
--- a/dom/media/ogg/OggCodecStore.h
+++ b/dom/media/ogg/OggCodecStore.h
@@ -29,7 +29,7 @@ class OggCodecStore {
   nsClassHashtable<nsUint32HashKey, OggCodecState> mCodecStates;
 
   // Protects the |mCodecStates| and the |mKnownStreams| members.
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
 };
 
 }  // namespace mozilla
diff --git a/dom/media/platforms/AllocationPolicy.h b/dom/media/platforms/AllocationPolicy.h
index 50a2040c4b7d5..18784ea28c7d9 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;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
 };
 
 /** 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;
+  ReentrantMonitor mMonitor MOZ_UNANNOTATED;
   // 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 9b0342ce82c35..ffb3be4c9f038 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;
+  static StaticMutex sMonitor MOZ_UNANNOTATED;
 };
 
 bool PDMInitializer::sHasInitializedPDMs = false;
diff --git a/dom/media/platforms/SimpleMap.h b/dom/media/platforms/SimpleMap.h
index 415e8542c9f33..c26bff1e9afd9 100644
--- a/dom/media/platforms/SimpleMap.h
+++ b/dom/media/platforms/SimpleMap.h
@@ -46,7 +46,7 @@ class SimpleMap {
   }
 
  private:
-  Mutex mMutex;  // To protect mMap.
+  Mutex mMutex MOZ_UNANNOTATED;  // To protect mMap.
   AutoTArray<Element, 16> mMap;
 };
 
diff --git a/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h b/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h
index 63a5944fe6324..06d72e3aae546 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   RefPtr<CDMProxy> mProxy;
   struct SampleEntry {
     RefPtr<MediaRawData> mSample;
diff --git a/dom/media/platforms/apple/AppleVTDecoder.h b/dom/media/platforms/apple/AppleVTDecoder.h
index 84d99badcbddd..167d28c6ff8a9 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<bool> mIsFlushing;
   // Protects mReorderQueue and mPromise.
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   ReorderQueue mReorderQueue;
   MozMonitoredPromiseHolder<DecodePromise> mPromise;
 
diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h
index d89842bc251f0..1b0806728588c 100644
--- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h
@@ -65,8 +65,9 @@ class FFmpegDataDecoder<LIBAV_VER>
   AVCodecID mCodecID;  // set in constructor
 
  protected:
-  static StaticMutex sMutex;  // used to provide critical-section locking
-                              // for calls into ffmpeg
+  static StaticMutex sMutex
+      MOZ_UNANNOTATED;  // used to provide critical-section locking
+                        // for calls into ffmpeg
   const RefPtr<TaskQueue> mTaskQueue;  // set in constructor
 
  private:
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h
index c506d22430d4b..47e2485508099 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;
+  Mutex mSurfaceLock MOZ_UNANNOTATED;
   nsTArray<RefPtr<VideoFrameSurfaceVAAPI>> 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 a19e84db0015f..79e21b7285344 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;
+    static StaticMutex sMutex MOZ_UNANNOTATED;
     // 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 7cb6209aa083d..5e088c5d92a3f 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;
+  Mutex mLock MOZ_UNANNOTATED;
   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 f725c42cd8dd0..19e3f58398350 100644
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -242,7 +242,7 @@ already_AddRefed<MediaDataDecoder> WMFDecoderModule::CreateAudioDecoder(
 
 template <const GUID& aGuid>
 static bool CanCreateWMFDecoder() {
-  static StaticMutex sMutex;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
   StaticMutexAutoLock lock(sMutex);
   static Maybe<bool> result;
   if (result.isNothing()) {
diff --git a/dom/media/systemservices/CamerasChild.h b/dom/media/systemservices/CamerasChild.h
index d5218d29c50b9..62d4c0c64fe91 100644
--- a/dom/media/systemservices/CamerasChild.h
+++ b/dom/media/systemservices/CamerasChild.h
@@ -231,7 +231,7 @@ class CamerasChild final : public PCamerasChild {
 
   nsTArray<CapturerElement> mCallbacks;
   // Protects the callback arrays
-  Mutex mCallbackMutex;
+  Mutex mCallbackMutex MOZ_UNANNOTATED;
 
   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;
+  Mutex mRequestMutex MOZ_UNANNOTATED;
   // 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;
+  Monitor mReplyMonitor MOZ_UNANNOTATED;
   // Async response valid?
   bool mReceivedReply;
   // Async responses data contents;
diff --git a/dom/media/systemservices/MediaSystemResourceManager.cpp b/dom/media/systemservices/MediaSystemResourceManager.cpp
index 49574be8eac51..414ef8e81df1f 100644
--- a/dom/media/systemservices/MediaSystemResourceManager.cpp
+++ b/dom/media/systemservices/MediaSystemResourceManager.cpp
@@ -59,7 +59,7 @@ void MediaSystemResourceManager::Init() {
     return;
   }
 
-  ReentrantMonitor barrier("MediaSystemResourceManager::Init");
+  ReentrantMonitor barrier MOZ_UNANNOTATED("MediaSystemResourceManager::Init");
   ReentrantMonitorAutoEnter mainThreadAutoMon(barrier);
   bool done = false;
 
@@ -191,7 +191,8 @@ bool MediaSystemResourceManager::AcquireSyncNoWait(
   MOZ_ASSERT(aClient);
   MOZ_ASSERT(!InImageBridgeChildThread());
 
-  ReentrantMonitor barrier("MediaSystemResourceManager::AcquireSyncNoWait");
+  ReentrantMonitor barrier MOZ_UNANNOTATED(
+      "MediaSystemResourceManager::AcquireSyncNoWait");
   ReentrantMonitorAutoEnter autoMon(barrier);
   bool done = false;
   {
diff --git a/dom/media/systemservices/MediaSystemResourceManager.h b/dom/media/systemservices/MediaSystemResourceManager.h
index 98dd1e8f4bf5d..293595ece0f9e 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;
+  ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
 
   bool mShutDown;
 
diff --git a/dom/media/systemservices/MediaUtils.h b/dom/media/systemservices/MediaUtils.h
index 18f1104b9b889..7af2ccaef042b 100644
--- a/dom/media/systemservices/MediaUtils.h
+++ b/dom/media/systemservices/MediaUtils.h
@@ -225,7 +225,7 @@ void Await(already_AddRefed<nsIEventTarget> aPool,
            RejectFunction&& aRejectFunction) {
   RefPtr<TaskQueue> taskQueue =
       new TaskQueue(std::move(aPool), "MozPromiseAwait");
-  Monitor mon(__func__);
+  Monitor mon MOZ_UNANNOTATED(__func__);
   bool done = false;
 
   aPromise->Then(
@@ -256,7 +256,7 @@ Await(already_AddRefed<nsIEventTarget> aPool,
       RefPtr<MozPromise<ResolveValueType, RejectValueType, Excl>> aPromise) {
   RefPtr<TaskQueue> taskQueue =
       new TaskQueue(std::move(aPool), "MozPromiseAwait");
-  Monitor mon(__func__);
+  Monitor mon MOZ_UNANNOTATED(__func__);
   bool done = false;
 
   typename MozPromise<ResolveValueType, RejectValueType,
@@ -400,7 +400,7 @@ class AsyncBlockers {
     mPromise->Resolve(true, __func__);
     mResolved = true;
   }
-  Mutex mLock;  // protects mBlockers and mResolved.
+  Mutex mLock MOZ_UNANNOTATED;  // protects mBlockers and mResolved.
   std::map<void*, bool> mBlockers;
   bool mResolved = false;
   const RefPtr<GenericPromise::Private> mPromise;
diff --git a/dom/media/systemservices/OSXRunLoopSingleton.cpp b/dom/media/systemservices/OSXRunLoopSingleton.cpp
index 06199bcbc8289..6dea084e279b3 100644
--- a/dom/media/systemservices/OSXRunLoopSingleton.cpp
+++ b/dom/media/systemservices/OSXRunLoopSingleton.cpp
@@ -12,7 +12,7 @@
 #include <CoreFoundation/CoreFoundation.h>
 
 static bool gRunLoopSet = false;
-static mozilla::StaticMutex gMutex;
+static mozilla::StaticMutex gMutex MOZ_UNANNOTATED;
 
 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 f1f5a7e4defe6..525ee79abc836 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;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
   SLObjectItf mSLEngine;
   int mSLEngineUsers;
   bool mIsRealized;
diff --git a/dom/media/systemservices/ShmemPool.h b/dom/media/systemservices/ShmemPool.h
index f4ae91246232c..4a08f0892b632 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   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 4d82d8927d2ce..e3081c3f49c9d 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
   webrtc::DesktopCapturer::Callback* mCallback = nullptr;
 
   uint64_t mBrowserId = 0;
diff --git a/dom/media/webaudio/AudioBuffer.cpp b/dom/media/webaudio/AudioBuffer.cpp
index d8371c96d4c07..c4a745e549736 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;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
   static StaticRefPtr<AudioBufferMemoryTracker> sSingleton;
   nsTHashSet<const AudioBuffer*> mBuffers;
 };
diff --git a/dom/media/webaudio/ScriptProcessorNode.cpp b/dom/media/webaudio/ScriptProcessorNode.cpp
index 0abadc204e2b4..43d02e09a017a 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;
+    Mutex mMutex MOZ_UNANNOTATED;
     // The list representing the queue.
     BufferList mBufferList;
   };
diff --git a/dom/media/webaudio/blink/HRTFDatabaseLoader.h b/dom/media/webaudio/blink/HRTFDatabaseLoader.h
index 05668b4e73aaa..060d9e7a6c9b8 100644
--- a/dom/media/webaudio/blink/HRTFDatabaseLoader.h
+++ b/dom/media/webaudio/blink/HRTFDatabaseLoader.h
@@ -143,7 +143,7 @@ class HRTFDatabaseLoader {
   nsAutoRef<HRTFDatabase> m_hrtfDatabase;
 
   // Holding a m_threadLock is required when accessing m_databaseLoaderThread.
-  mozilla::Mutex m_threadLock;
+  mozilla::Mutex m_threadLock MOZ_UNANNOTATED;
   PRThread* m_databaseLoaderThread;
 
   float m_databaseSampleRate;
diff --git a/dom/media/webaudio/blink/ReverbConvolver.h b/dom/media/webaudio/blink/ReverbConvolver.h
index 09e61d69df320..8000ba811e7f9 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;
+  mozilla::Monitor m_backgroundThreadMonitor MOZ_UNANNOTATED;
   bool m_useBackgroundThreads;
   std::atomic<bool> m_wantsToExit;
   std::atomic<bool> m_moreInputBuffered;
diff --git a/dom/media/webm/WebMBufferedParser.h b/dom/media/webm/WebMBufferedParser.h
index 80f08fd803213..3dd4767f9f155 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;
+  ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
 
   // 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 ce0badf66b7d5..b5e705ea7d36e 100644
--- a/dom/media/webrtc/CubebDeviceEnumerator.cpp
+++ b/dom/media/webrtc/CubebDeviceEnumerator.cpp
@@ -23,7 +23,7 @@ using AudioDeviceSet = CubebDeviceEnumerator::AudioDeviceSet;
 
 /* static */
 static StaticRefPtr<CubebDeviceEnumerator> sInstance;
-static StaticMutex sInstanceMutex;
+static StaticMutex sInstanceMutex MOZ_UNANNOTATED;
 
 /* static */
 CubebDeviceEnumerator* CubebDeviceEnumerator::GetInstance() {
diff --git a/dom/media/webrtc/CubebDeviceEnumerator.h b/dom/media/webrtc/CubebDeviceEnumerator.h
index 18aef5a974bf2..2dee70ad63d41 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<const AudioDeviceSet> EnumerateAudioDevices(Side aSide);
   // Synchronize access to mInputDevices and mOutputDevices;
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   RefPtr<const AudioDeviceSet> mInputDevices;
   RefPtr<const AudioDeviceSet> 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 9d15682627794..cecf88288c384 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 c503cff854df9..328484da16b8c 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;
+  mutable RWLock mLock MOZ_UNANNOTATED;
 
   // Call worker thread. All access to mCall->Call() happens here.
   const RefPtr<AbstractThread> mCallThread;
diff --git a/dom/media/webrtc/libwebrtcglue/VideoConduit.h b/dom/media/webrtc/libwebrtcglue/VideoConduit.h
index 20df082fbb7a6..4a15e14bf3e38 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;
+  mutable mozilla::ReentrantMonitor mRendererMonitor MOZ_UNANNOTATED;
 
   // Accessed on any thread under mRendererMonitor.
   RefPtr<mozilla::VideoRenderer> mRenderer;
@@ -328,7 +328,7 @@ class WebrtcVideoConduit
   // that will update the webrtc.org configuration.
   WatchManager<WebrtcVideoConduit> mWatchManager;
 
-  mutable Mutex mMutex;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 6993f8a9eed68..bbcd6773af524 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;
+  Mutex mCallbackMutex MOZ_UNANNOTATED;
   webrtc::EncodedImageCallback* mCallback;
   Maybe<uint64_t> mCachedPluginId;
   const std::string mPCHandle;
@@ -430,7 +430,7 @@ class WebrtcGmpVideoDecoder : public GMPVideoDecoderCallbackProxy {
   nsTArray<UniquePtr<GMPDecodeData>> mQueuedFrames;
   GMPVideoHost* mHost;
   // Protects mCallback
-  Mutex mCallbackMutex;
+  Mutex mCallbackMutex MOZ_UNANNOTATED;
   webrtc::DecodedImageCallback* mCallback;
   Maybe<uint64_t> mCachedPluginId;
   Atomic<GMPErr, ReleaseAcquire> mDecoderStatus;
diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcMediaDataEncoderCodec.h b/dom/media/webrtc/libwebrtcglue/WebrtcMediaDataEncoderCodec.h
index 1e86f5dd227dc..dcda01c5cede2 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<PEMFactory> mFactory;
   RefPtr<MediaDataEncoder> mEncoder;
 
-  Mutex mCallbackMutex;  // Protects mCallback and mError.
+  Mutex mCallbackMutex MOZ_UNANNOTATED;  // 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 8616e796827df..010fcb59bc203 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<nr_udp_message> msg);
 
-  ReentrantMonitor monitor_;  // protects err_and state_
+  ReentrantMonitor monitor_ MOZ_UNANNOTATED;  // 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 c0afec49e8610..73b23523a7fe3 100644
--- a/dom/media/webrtc/transportbridge/MediaPipeline.cpp
+++ b/dom/media/webrtc/transportbridge/MediaPipeline.cpp
@@ -1546,7 +1546,7 @@ class MediaPipelineReceiveVideo::PipelineListener
 
  private:
   RefPtr<layers::ImageContainer> mImageContainer;
-  Mutex mMutex;  // Protects the below members.
+  Mutex mMutex MOZ_UNANNOTATED;  // 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 10a1127275c55..cadfc1b2495ec 100644
--- a/dom/midi/MIDIMessageQueue.h
+++ b/dom/midi/MIDIMessageQueue.h
@@ -49,7 +49,7 @@ class MIDIMessageQueue {
   // Array of messages to be sent.
   nsTArray<MIDIMessage> mMessageQueue;
   // Mutex for coordinating cross thread array access.
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace dom
diff --git a/dom/midi/MIDIPlatformService.h b/dom/midi/MIDIPlatformService.h
index 7dfa3ec1dc791..ad55757581d6c 100644
--- a/dom/midi/MIDIPlatformService.h
+++ b/dom/midi/MIDIPlatformService.h
@@ -149,7 +149,7 @@ class MIDIPlatformService {
   nsClassHashtable<nsStringHashKey, MIDIMessageQueue> mMessageQueues;
 
   // Mutex for managing access to message queue objects.
-  Mutex mMessageQueueMutex;
+  Mutex mMessageQueueMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace mozilla::dom
diff --git a/dom/midi/midirMIDIPlatformService.h b/dom/midi/midirMIDIPlatformService.h
index 0a918b91cdd5d..ac13c06b6a41c 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;
+  static StaticMutex gBackgroundThreadMutex MOZ_UNANNOTATED;
   static nsCOMPtr<nsIThread> gBackgroundThread;
 };
 
diff --git a/dom/performance/PerformanceService.cpp b/dom/performance/PerformanceService.cpp
index 43eed2ed4eec8..746d278b77ae2 100644
--- a/dom/performance/PerformanceService.cpp
+++ b/dom/performance/PerformanceService.cpp
@@ -14,7 +14,7 @@
 namespace mozilla::dom {
 
 static StaticRefPtr<PerformanceService> gPerformanceService;
-static StaticMutex gPerformanceServiceMutex;
+static StaticMutex gPerformanceServiceMutex MOZ_UNANNOTATED;
 
 /* static */
 PerformanceService* PerformanceService::GetOrCreate() {
diff --git a/dom/performance/PerformanceStorageWorker.h b/dom/performance/PerformanceStorageWorker.h
index 6e7f6e37d8f77..aedc36e599eb6 100644
--- a/dom/performance/PerformanceStorageWorker.h
+++ b/dom/performance/PerformanceStorageWorker.h
@@ -37,7 +37,7 @@ class PerformanceStorageWorker final : public PerformanceStorage {
   PerformanceStorageWorker();
   ~PerformanceStorageWorker();
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 0e93bbc9e0219..75098dd1ab270 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;
+  Mutex mCleanUpLock MOZ_UNANNOTATED;
 };
 }  // namespace dom
 }  // namespace mozilla
diff --git a/dom/quota/QuotaManager.h b/dom/quota/QuotaManager.h
index d23b2be08e47d..c3cbd2eb758a8 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;
+  mutable mozilla::Mutex mQuotaMutex MOZ_UNANNOTATED;
 
   nsClassHashtable<nsCStringHashKey, GroupInfoPair> mGroupInfoPairs;
 
diff --git a/dom/serviceworkers/ServiceWorkerRegistrar.h b/dom/serviceworkers/ServiceWorkerRegistrar.h
index 9fdd246d07645..b8eeab53954b2 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;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
 
   // protected by mMonitor.
   nsCOMPtr<nsIFile> mProfileDir;
diff --git a/dom/storage/LocalStorageCache.h b/dom/storage/LocalStorageCache.h
index 4c9f9a480dd48..2c786c8a59017 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;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
 
   // 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 846e5bf2ef172..2bbfd90163285 100644
--- a/dom/storage/StorageDBThread.cpp
+++ b/dom/storage/StorageDBThread.cpp
@@ -71,7 +71,7 @@ StorageDBBridge::StorageDBBridge()
 
 class StorageDBThread::InitHelper final : public Runnable {
   nsCOMPtr<nsIEventTarget> mOwningThread;
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   mozilla::CondVar mCondVar;
   nsString mProfilePath;
   nsresult mMainThreadResultCode;
diff --git a/dom/storage/StorageDBThread.h b/dom/storage/StorageDBThread.h
index 068a65df31d55..d3b131fea097f 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;
+    Monitor mMonitor MOZ_UNANNOTATED;
   };
 
   class InitHelper;
diff --git a/dom/storage/StorageIPC.cpp b/dom/storage/StorageIPC.cpp
index 3f1bfcb81a533..82ceae30f99c2 100644
--- a/dom/storage/StorageIPC.cpp
+++ b/dom/storage/StorageIPC.cpp
@@ -849,7 +849,7 @@ class SyncLoadCacheHelper : public LocalStorageCacheBridge {
   }
 
  private:
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   nsCString mSuffix, mOrigin;
   nsTArray<nsString>* mKeys;
   nsTArray<nsString>* mValues;
diff --git a/dom/webauthn/U2FHIDTokenManager.cpp b/dom/webauthn/U2FHIDTokenManager.cpp
index 3b37347c5332f..df5c5ceb26069 100644
--- a/dom/webauthn/U2FHIDTokenManager.cpp
+++ b/dom/webauthn/U2FHIDTokenManager.cpp
@@ -13,7 +13,7 @@
 namespace mozilla {
 namespace dom {
 
-static StaticMutex gInstanceMutex;
+static StaticMutex gInstanceMutex MOZ_UNANNOTATED;
 static U2FHIDTokenManager* gInstance;
 static nsIThread* gPBackgroundThread;
 
diff --git a/dom/webauthn/U2FTokenManager.cpp b/dom/webauthn/U2FTokenManager.cpp
index 8adf1709a760b..9a334ff590cb2 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;
+  Mutex mPrefMutex MOZ_UNANNOTATED;
   bool mSoftTokenEnabled;
   int mSoftTokenCounter;
   bool mUsbTokenEnabled;
diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.cpp b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
index 991a2117329c5..2a855788d5095 100644
--- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp
+++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ -121,7 +121,7 @@ struct nsWebBrowserPersist::OutputData {
   nsCOMPtr<nsIURI> mFile;
   nsCOMPtr<nsIURI> mOriginalLocation;
   nsCOMPtr<nsIOutputStream> mStream;
-  Mutex mStreamMutex;
+  Mutex mStreamMutex MOZ_UNANNOTATED;
   int64_t mSelfProgress;
   int64_t mSelfProgressMax;
   bool mCalcFileExt;
diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.h b/dom/webbrowserpersist/nsWebBrowserPersist.h
index a34370713f7af..47f13b1cb472e 100644
--- a/dom/webbrowserpersist/nsWebBrowserPersist.h
+++ b/dom/webbrowserpersist/nsWebBrowserPersist.h
@@ -155,7 +155,7 @@ class nsWebBrowserPersist final : public nsIInterfaceRequestor,
    */
   nsCOMPtr<nsIWebProgressListener2> mProgressListener2;
   nsCOMPtr<nsIProgressEventSink> mEventSink;
-  mozilla::Mutex mOutputMapMutex;
+  mozilla::Mutex mOutputMapMutex MOZ_UNANNOTATED;
   nsClassHashtable<nsISupportsHashKey, OutputData> mOutputMap;
   nsClassHashtable<nsISupportsHashKey, UploadData> mUploadList;
   nsCOMPtr<nsISerialEventTarget> mBackgroundQueue;
diff --git a/dom/webgpu/ipc/WebGPUParent.cpp b/dom/webgpu/ipc/WebGPUParent.cpp
index 9279b2c697277..d23f84132f28b 100644
--- a/dom/webgpu/ipc/WebGPUParent.cpp
+++ b/dom/webgpu/ipc/WebGPUParent.cpp
@@ -63,7 +63,7 @@ class PresentationData {
   std::vector<RawId> mUnassignedBufferIds;
   std::vector<RawId> mAvailableBufferIds;
   std::vector<RawId> mQueuedBufferIds;
-  Mutex mBuffersLock;
+  Mutex mBuffersLock MOZ_UNANNOTATED;
 
   PresentationData(RawId aDeviceId, RawId aQueueId,
                    already_AddRefed<layers::WebRenderImageHost> aImageHost,
diff --git a/dom/websocket/WebSocket.cpp b/dom/websocket/WebSocket.cpp
index ccd42676e126c..4486f37c830a4 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   bool mWorkerShuttingDown;
 
   RefPtr<WebSocketEventService> mService;
diff --git a/dom/websocket/WebSocket.h b/dom/websocket/WebSocket.h
index e73c5fd705df6..d94fd64f9ebe9 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 7b4d80143238c..646ea2c43b940 100644
--- a/dom/workers/Queue.h
+++ b/dom/workers/Queue.h
@@ -54,7 +54,7 @@ struct StorageWithTArray {
 };
 
 class LockingWithMutex {
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
  protected:
   LockingWithMutex() : mMutex("LockingWithMutex::mMutex") {}
diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp
index 2f62e220e6169..28e946af6ba44 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
   nsCString mMsg;
   FlippedOnce<false> mHasMsg;
 };
diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h
index 0ca5f99fab6fe..71b18316f30a2 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   // Protected by mMutex.
   nsClassHashtable<nsCStringHashKey, WorkerDomainInfo> mDomainMap;
diff --git a/dom/workers/WorkerCSPEventListener.h b/dom/workers/WorkerCSPEventListener.h
index 007cca41aff9d..f3491316aaae9 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // Protected by mutex.
   RefPtr<WeakWorkerRef> mWorkerRef;
diff --git a/dom/workers/WorkerDebuggerManager.h b/dom/workers/WorkerDebuggerManager.h
index 53fe35f1cb5c2..1b09a230d19f0 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // Protected by mMutex.
   nsTArray<nsCOMPtr<nsIWorkerDebuggerManagerListener>> mListeners;
diff --git a/dom/workers/WorkerDocumentListener.h b/dom/workers/WorkerDocumentListener.h
index edb9a78ee62b8..4bb46cadf2ab5 100644
--- a/dom/workers/WorkerDocumentListener.h
+++ b/dom/workers/WorkerDocumentListener.h
@@ -31,7 +31,7 @@ class WorkerDocumentListener final {
  private:
   ~WorkerDocumentListener();
 
-  Mutex mMutex;  // protects mWorkerRef
+  Mutex mMutex MOZ_UNANNOTATED;  // protects mWorkerRef
   RefPtr<ThreadSafeWorkerRef> mWorkerRef;
 };
 
diff --git a/dom/workers/WorkerEventTarget.h b/dom/workers/WorkerEventTarget.h
index 7260fb8b0ca30..f3a72aff7d609 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   CheckedUnsafePtr<WorkerPrivate> mWorkerPrivate;
   const Behavior mBehavior;
 
diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
index adac5597d155d..eff33ba065eb8 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   WorkerPrivate* mWorkerPrivate;
   nsIEventTarget* mWeakNestedEventTarget;
   nsCOMPtr<nsIEventTarget> mNestedEventTarget;
diff --git a/dom/workers/WorkerThread.h b/dom/workers/WorkerThread.h
index 1ab6be3b7e72e..a0bbf2369ad8b 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;
+  Mutex mLock MOZ_UNANNOTATED;
   CondVar mWorkerPrivateCondVar;
 
   // Protected by nsThread::mLock.
diff --git a/dom/xhr/XMLHttpRequestMainThread.h b/dom/xhr/XMLHttpRequestMainThread.h
index ec8852d7b2efe..b61464389306a 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // All of these are protected by mMutex.
   uint8_t* mDataPtr;
diff --git a/dom/xhr/XMLHttpRequestString.cpp b/dom/xhr/XMLHttpRequestString.cpp
index f3d953971bb06..01416c08aec54 100644
--- a/dom/xhr/XMLHttpRequestString.cpp
+++ b/dom/xhr/XMLHttpRequestString.cpp
@@ -82,7 +82,7 @@ class XMLHttpRequestStringBuffer final {
 
   nsString& UnsafeData() { return mData; }
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // The following member variable is protected by mutex.
   nsString mData;
diff --git a/extensions/permissions/PermissionManager.h b/extensions/permissions/PermissionManager.h
index 114603450a398..c659cba268545 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;
+  static StaticMutex sCreationMutex MOZ_UNANNOTATED;
 
   /**
    * 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   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 78d680cec0ffa..584c7edf56af6 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<nsIFile> mFile;
-  mozilla::Monitor mMonitor;
-  mozilla::Monitor mMonitorSave;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
+  mozilla::Monitor mMonitorSave MOZ_UNANNOTATED;
   nsTHashSet<nsString> mDictionaryTable;
   nsTHashSet<nsString> mIgnoreTable;
 
diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h
index 37ce1a3e17387..9d42f636dda1b 100644
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -998,7 +998,7 @@ class SharedFTFace : public external::AtomicRefCounted<SharedFTFace> {
  private:
   FT_Face mFace;
   SharedFTFaceData* mData;
-  Mutex mLock;
+  Mutex mLock MOZ_UNANNOTATED;
   // 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;
+  static StaticMutex mFTLock MOZ_UNANNOTATED;
 
  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;
+  static StaticMutex mDeviceLock MOZ_UNANNOTATED;
   // This synchronizes access between different D2D drawtargets and their
   // implied dependency graph.
-  static StaticMutex mDTDependencyLock;
+  static StaticMutex mDTDependencyLock MOZ_UNANNOTATED;
 
   friend class DrawTargetD2D1;
 #endif  // WIN32
diff --git a/gfx/2d/DrawTargetSkia.h b/gfx/2d/DrawTargetSkia.h
index 571871c66d028..7ac9741ffee12 100644
--- a/gfx/2d/DrawTargetSkia.h
+++ b/gfx/2d/DrawTargetSkia.h
@@ -191,7 +191,7 @@ class DrawTargetSkia : public DrawTarget {
   SkCanvas* mCanvas = nullptr;
   RefPtr<DataSourceSurface> mBackingSurface;
   RefPtr<SourceSurfaceSkia> mSnapshot;
-  Mutex mSnapshotLock;
+  Mutex mSnapshotLock MOZ_UNANNOTATED;
 
 #ifdef MOZ_WIDGET_COCOA
   friend class BorrowedCGContext;
diff --git a/gfx/2d/NativeFontResourceDWrite.cpp b/gfx/2d/NativeFontResourceDWrite.cpp
index fa646e91b332e..e0b599fa767df 100644
--- a/gfx/2d/NativeFontResourceDWrite.cpp
+++ b/gfx/2d/NativeFontResourceDWrite.cpp
@@ -17,7 +17,7 @@
 namespace mozilla {
 namespace gfx {
 
-static StaticMutex sFontFileStreamsMutex;
+static StaticMutex sFontFileStreamsMutex MOZ_UNANNOTATED;
 static uint64_t sNextFontFileKey = 0;
 static std::unordered_map<uint64_t, IDWriteFontFileStream*> sFontFileStreams;
 
diff --git a/gfx/2d/SourceSurfaceSkia.h b/gfx/2d/SourceSurfaceSkia.h
index ce411dac6a98b..5f3d154546693 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<DrawTargetSkia*> mDrawTarget;
-  Mutex mChangeMutex;
+  Mutex mChangeMutex MOZ_UNANNOTATED;
   bool mIsMapped;
 };
 
diff --git a/gfx/gl/AndroidSurfaceTexture.cpp b/gfx/gl/AndroidSurfaceTexture.cpp
index 9ccbd71360b5f..c461082442d31 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;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
   static StaticRefPtr<GLContextEGL> sContext;
   static size_t sInstanceCount;
 
diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp
index 5243dab4b7f7d..51c216b0012ec 100644
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -1211,7 +1211,7 @@ GLContext* GLContextProviderEGL::GetGlobalContext() { return nullptr; }
 
 // -
 
-static StaticMutex sMutex;
+static StaticMutex sMutex MOZ_UNANNOTATED;
 static StaticRefPtr<GLLibraryEGL> gDefaultEglLibrary;
 
 RefPtr<GLLibraryEGL> DefaultEglLibrary(nsACString* const out_failureId) {
diff --git a/gfx/gl/SharedSurface.h b/gfx/gl/SharedSurface.h
index 5d3ac6462a54f..060db717c01dd 100644
--- a/gfx/gl/SharedSurface.h
+++ b/gfx/gl/SharedSurface.h
@@ -150,7 +150,7 @@ class SurfaceFactory {
   const PartialSharedSurfaceDesc mDesc;
 
  protected:
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
  public:
   static UniquePtr<SurfaceFactory> Create(GLContext*, layers::TextureType);
diff --git a/gfx/gl/SharedSurfaceEGL.h b/gfx/gl/SharedSurfaceEGL.h
index 2083f8f825847..569421f945a10 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;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
   EGLSync mSync = 0;
 
  public:
diff --git a/gfx/layers/AndroidHardwareBuffer.h b/gfx/layers/AndroidHardwareBuffer.h
index 00dda502e1593..2328170c391ab 100644
--- a/gfx/layers/AndroidHardwareBuffer.h
+++ b/gfx/layers/AndroidHardwareBuffer.h
@@ -223,7 +223,7 @@ class AndroidHardwareBufferManager {
   Monitor& GetMonitor() { return mMonitor; }
 
  private:
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   std::unordered_map<uint64_t, ThreadSafeWeakPtr<AndroidHardwareBuffer>>
       mBuffers;
 
diff --git a/gfx/layers/CompositorAnimationStorage.h b/gfx/layers/CompositorAnimationStorage.h
index 1450928573e13..9eb6a5ffa462a 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<uint64_t> mNewAnimations;
-  mutable Mutex mLock;
+  mutable Mutex mLock MOZ_UNANNOTATED;
   // CompositorBridgeParent owns this CompositorAnimationStorage instance.
   CompositorBridgeParent* MOZ_NON_OWNING_REF mCompositorBridge;
 };
diff --git a/gfx/layers/DMABUFSurfaceImage.cpp b/gfx/layers/DMABUFSurfaceImage.cpp
index 2e29ca13c1857..792147344315c 100644
--- a/gfx/layers/DMABUFSurfaceImage.cpp
+++ b/gfx/layers/DMABUFSurfaceImage.cpp
@@ -38,7 +38,7 @@ DMABUFSurfaceImage::~DMABUFSurfaceImage() {
 }
 
 StaticRefPtr<GLContext> sSnapshotContext;
-static StaticMutex sSnapshotContextMutex;
+static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED;
 
 already_AddRefed<gfx::SourceSurface> DMABUFSurfaceImage::GetAsSourceSurface() {
   if (!sSnapshotContext) {
diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h
index b95c157972f70..a4e1176a9b26b 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;
+  Mutex mLock MOZ_UNANNOTATED;
 
   // 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;
+  Mutex mLock MOZ_UNANNOTATED;
   ImageContainer* mImageContainer;
 };
 
@@ -543,7 +543,7 @@ class ImageContainer final : public SupportsThreadSafeWeakPtr<ImageContainer> {
 
   // RecursiveMutex to protect thread safe access to the "current
   // image", and any other state which is shared between threads.
-  RecursiveMutex mRecursiveMutex;
+  RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED;
 
   RefPtr<TextureClientRecycleAllocator> mRecycleAllocator;
 
diff --git a/gfx/layers/NativeLayerCA.h b/gfx/layers/NativeLayerCA.h
index 43f5e4c91e52a..1fb4cf604e3eb 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;  // protects all other fields
+  Mutex mMutex MOZ_UNANNOTATED;  // 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 ce6686956cca5..0c45adc3119d4 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   const RefPtr<SurfacePoolHandleWayland> mSurfacePoolHandle;
   const gfx::IntSize mSize;
diff --git a/gfx/layers/ProfilerScreenshots.h b/gfx/layers/ProfilerScreenshots.h
index 6ffa0c25b0dc0..8239c704037f5 100644
--- a/gfx/layers/ProfilerScreenshots.h
+++ b/gfx/layers/ProfilerScreenshots.h
@@ -101,7 +101,7 @@ class ProfilerScreenshots final {
   // threads, protected by mMutex.
   nsTArray<RefPtr<gfx::DataSourceSurface>> mAvailableSurfaces;
   // Protects mAvailableSurfaces.
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   // 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 dabee2e67b271..73743a839dbf1 100644
--- a/gfx/layers/SourceSurfaceSharedData.h
+++ b/gfx/layers/SourceSurfaceSharedData.h
@@ -326,7 +326,7 @@ class SourceSurfaceSharedData : public DataSourceSurface {
    */
   void CloseHandleInternal();
 
-  mutable Mutex mMutex;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
   int32_t mStride;
   int32_t mHandleCount;
   Maybe<IntRect> mDirtyRect;
diff --git a/gfx/layers/SurfacePoolWayland.h b/gfx/layers/SurfacePoolWayland.h
index a5640ce0619c1..6a746e732cd7b 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 ddbe46e899c97..bd8f56732002a 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;
+  static StaticMutex sWindowIdLock MOZ_UNANNOTATED;
   static StaticAutoPtr<std::unordered_map<uint64_t, RefPtr<APZSampler>>>
       sWindowIdMap;
   Maybe<wr::WrWindowId> mWindowId;
 
   // Lock used to protected mSamplerThreadId
-  mutable Mutex mThreadIdLock;
+  mutable Mutex mThreadIdLock MOZ_UNANNOTATED;
   // 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<PlatformThreadId> mSamplerThreadId;
 
-  Mutex mSampleTimeLock;
+  Mutex mSampleTimeLock MOZ_UNANNOTATED;
   // 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 a7d6595da167c..7b9a2eed500a5 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;
+  static StaticMutex sWindowIdLock MOZ_UNANNOTATED;
   static StaticAutoPtr<std::unordered_map<uint64_t, APZUpdater*>> sWindowIdMap;
   Maybe<wr::WrWindowId> mWindowId;
 
   // Lock used to protected mUpdaterThreadId;
-  mutable Mutex mThreadIdLock;
+  mutable Mutex mThreadIdLock MOZ_UNANNOTATED;
   // 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;
+  Mutex mQueueLock MOZ_UNANNOTATED;
   // 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 8301555e35b97..7b082e2e56e42 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;
+  mutable mozilla::RecursiveMutex mTreeLock MOZ_UNANNOTATED;
   RefPtr<HitTestingTreeNode> 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;
+  mutable mozilla::Mutex mMapLock MOZ_UNANNOTATED;
 
   /**
    * 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, UniquePtr<APZTestData>, LayersId::HashFn>
       mTestData;
-  mutable mozilla::Mutex mTestDataLock;
+  mutable mozilla::Mutex mTestDataLock MOZ_UNANNOTATED;
 
   // 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;
+  mozilla::Mutex mScrollGenerationLock MOZ_UNANNOTATED;
 
 #if defined(MOZ_WIDGET_ANDROID)
  private:
diff --git a/gfx/layers/apz/src/AsyncPanZoomController.h b/gfx/layers/apz/src/AsyncPanZoomController.h
index e4096b8a07742..d2f1c3621b3a7 100644
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -964,7 +964,7 @@ class AsyncPanZoomController {
      updater thread. */
   RefPtr<GeckoContentController> mGeckoContentController;
   RefPtr<GestureEventListener> mGestureEventListener;
-  mutable Monitor mRefPtrMonitor;
+  mutable Monitor mRefPtrMonitor MOZ_UNANNOTATED;
 
   // 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;
+  mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED;
 
  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;
+  Mutex mCheckerboardEventLock MOZ_UNANNOTATED;
   // 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 aeececcd6e14e..ad7fa83b2bd75 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;
+  mutable Monitor mRendertraceLock MOZ_UNANNOTATED;
   /**
    * 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 37c44ec698371..14d536be3e558 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;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
 
   // The set of focus targets received indexed by their layer tree ID
   std::unordered_map<LayersId, FocusTarget, LayersId::HashFn> mFocusTree;
diff --git a/gfx/layers/apz/util/APZThreadUtils.cpp b/gfx/layers/apz/util/APZThreadUtils.cpp
index 68f385f57162c..f2b069e72df46 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<nsISerialEventTarget> sControllerThread;
-static StaticMutex sControllerThreadMutex;
+static StaticMutex sControllerThreadMutex MOZ_UNANNOTATED;
 
 /*static*/
 void APZThreadUtils::SetThreadAssertionsEnabled(bool aEnabled) {
diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp
index e0565ea8961bb..dc325cc57147b 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("DeallocateTextureClient");
+      ReentrantMonitor barrier MOZ_UNANNOTATED("DeallocateTextureClient");
       ReentrantMonitorAutoEnter autoMon(barrier);
       ipdlThread->Dispatch(NewRunnableFunction(
           "DeallocateTextureClientSyncProxyRunnable",
diff --git a/gfx/layers/client/TextureClientRecycleAllocator.h b/gfx/layers/client/TextureClientRecycleAllocator.h
index 37a5f26a7f5c2..4abaa60c4e7c2 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<RefPtr<TextureClientHolder> > mPooledClients;
-  Mutex mLock;
+  Mutex mLock MOZ_UNANNOTATED;
   bool mIsDestroyed;
 };
 
diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h
index 9cbeb335d9b1b..7b176846e8dd7 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;
+  Mutex mSyncLock MOZ_UNANNOTATED;
   RefPtr<ID3D11Texture2D> mSyncTexture;
   std::vector<ID3D11Texture2D*> mSyncedTextures;
 
diff --git a/gfx/layers/ipc/CompositableInProcessManager.h b/gfx/layers/ipc/CompositableInProcessManager.h
index 9c6f24a4ffa29..e5257a985eb78 100644
--- a/gfx/layers/ipc/CompositableInProcessManager.h
+++ b/gfx/layers/ipc/CompositableInProcessManager.h
@@ -59,7 +59,7 @@ class CompositableInProcessManager final {
   static std::map<std::pair<base::ProcessId, uint64_t>,
                   RefPtr<WebRenderImageHost>>
       sCompositables;
-  static StaticMutex sMutex;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
 
   static uint32_t sNamespace;
   static Atomic<uint32_t> sNextResourceId;
diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h
index 57cefb64bf785..41d45e25b8a85 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;
-  mozilla::Monitor mResumeCompositionMonitor;
+  mozilla::Monitor mPauseCompositionMonitor MOZ_UNANNOTATED;
+  mozilla::Monitor mResumeCompositionMonitor MOZ_UNANNOTATED;
 
   uint64_t mCompositorBridgeID;
   LayersId mRootLayerTreeID;
diff --git a/gfx/layers/ipc/CompositorManagerParent.h b/gfx/layers/ipc/CompositorManagerParent.h
index cf0bdf6be16da..8678994ddefd2 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<CompositorManagerParent> sInstance;
-  static StaticMutex sMutex;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
 
 #ifdef COMPOSITOR_MANAGER_PARENT_EXPLICIT_SHUTDOWN
   static StaticAutoPtr<nsTArray<CompositorManagerParent*>> sActiveActors;
diff --git a/gfx/layers/ipc/CompositorVsyncScheduler.h b/gfx/layers/ipc/CompositorVsyncScheduler.h
index 2db6ff3a07fd8..8b6d2a8b6d1fe 100644
--- a/gfx/layers/ipc/CompositorVsyncScheduler.h
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.h
@@ -150,7 +150,7 @@ class CompositorVsyncScheduler {
    private:
     virtual ~Observer();
 
-    Mutex mMutex;
+    Mutex mMutex MOZ_UNANNOTATED;
     // Hold raw pointer to avoid mutual reference.
     CompositorVsyncScheduler* mOwner;
   };
@@ -170,12 +170,12 @@ class CompositorVsyncScheduler {
   widget::CompositorWidget* mWidget;
   RefPtr<CompositorVsyncScheduler::Observer> mVsyncObserver;
 
-  mozilla::Monitor mCurrentCompositeTaskMonitor;
+  mozilla::Monitor mCurrentCompositeTaskMonitor MOZ_UNANNOTATED;
   RefPtr<CancelableRunnable> mCurrentCompositeTask;
   // Accessed on multiple threads, guarded by mCurrentCompositeTaskMonitor.
   wr::RenderReasons mCurrentCompositeTaskReasons;
 
-  mozilla::Monitor mCurrentVRTaskMonitor;
+  mozilla::Monitor mCurrentVRTaskMonitor MOZ_UNANNOTATED;
   RefPtr<CancelableRunnable> mCurrentVRTask;
 };
 
diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp
index a167bda121d5f..9109046906a1d 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;
+static StaticMutex sImageBridgeSingletonLock MOZ_UNANNOTATED;
 static StaticRefPtr<ImageBridgeChild> sImageBridgeChildSingleton;
 static StaticRefPtr<nsIThread> sImageBridgeChildThread;
 
diff --git a/gfx/layers/ipc/ImageBridgeChild.h b/gfx/layers/ipc/ImageBridgeChild.h
index 01ea2c11787c9..1f33e26772722 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;
+  Mutex mContainerMapLock MOZ_UNANNOTATED;
   std::unordered_map<uint64_t, RefPtr<ImageContainerListener>>
       mImageContainerListeners;
   RefPtr<ImageContainerListener> FindListener(
diff --git a/gfx/layers/ipc/LayerTreeOwnerTracker.h b/gfx/layers/ipc/LayerTreeOwnerTracker.h
index a3454f250585a..651c695309ed6 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;
+  mozilla::Mutex mLayerIdsLock MOZ_UNANNOTATED;
   std::map<LayersId, base::ProcessId> mLayerIds;
 };
 
diff --git a/gfx/layers/ipc/SharedSurfacesParent.h b/gfx/layers/ipc/SharedSurfacesParent.h
index a4196690bc13d..1ccc99b2f0eb0 100644
--- a/gfx/layers/ipc/SharedSurfacesParent.h
+++ b/gfx/layers/ipc/SharedSurfacesParent.h
@@ -91,7 +91,7 @@ class SharedSurfacesParent final {
   static void ExpireMap(
       nsTArray<RefPtr<gfx::SourceSurfaceSharedDataWrapper>>& aExpired);
 
-  static StaticMonitor sMonitor;
+  static StaticMonitor sMonitor MOZ_UNANNOTATED;
 
   static StaticAutoPtr<SharedSurfacesParent> sInstance;
 
diff --git a/gfx/layers/ipc/SynchronousTask.h b/gfx/layers/ipc/SynchronousTask.h
index fc6acda81b091..41ad9fa5b28b4 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;
+  ReentrantMonitor mMonitor MOZ_UNANNOTATED;
   ReentrantMonitorAutoEnter mAutoEnter;
   bool mDone;
 };
diff --git a/gfx/layers/wr/AsyncImagePipelineManager.h b/gfx/layers/wr/AsyncImagePipelineManager.h
index 57797dbe2f8b4..0a9efe38691a2 100644
--- a/gfx/layers/wr/AsyncImagePipelineManager.h
+++ b/gfx/layers/wr/AsyncImagePipelineManager.h
@@ -263,7 +263,7 @@ class AsyncImagePipelineManager final {
 
   std::vector<std::pair<wr::RenderedFrameId, WebRenderPipelineInfoHolder>>
       mRenderSubmittedUpdates;
-  Mutex mRenderSubmittedUpdatesLock;
+  Mutex mRenderSubmittedUpdatesLock MOZ_UNANNOTATED;
 
   Atomic<uint64_t> mLastCompletedFrameId;
   std::vector<std::pair<wr::RenderedFrameId,
diff --git a/gfx/layers/wr/OMTASampler.h b/gfx/layers/wr/OMTASampler.h
index 6f151191a2cfa..513c905fa144a 100644
--- a/gfx/layers/wr/OMTASampler.h
+++ b/gfx/layers/wr/OMTASampler.h
@@ -119,7 +119,7 @@ class OMTASampler final {
   RefPtr<OMTAController> mController;
   // Can only be accessed or modified while holding mStorageLock.
   RefPtr<CompositorAnimationStorage> mAnimStorage;
-  mutable Mutex mStorageLock;
+  mutable Mutex mStorageLock MOZ_UNANNOTATED;
 
   // 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;
+  static StaticMutex sWindowIdLock MOZ_UNANNOTATED;
   static StaticAutoPtr<std::unordered_map<uint64_t, RefPtr<OMTASampler>>>
       sWindowIdMap;
   Maybe<wr::WrWindowId> mWindowId;
 
   // Lock used to protected mSamplerThreadId
-  mutable Mutex mThreadIdLock;
+  mutable Mutex mThreadIdLock MOZ_UNANNOTATED;
   // 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<PlatformThreadId> mSamplerThreadId;
 
-  Mutex mSampleTimeLock;
+  Mutex mSampleTimeLock MOZ_UNANNOTATED;
   // 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 e89d3769a98f0..dcc97c2f08bd9 100644
--- a/gfx/src/gfxCrashReporterUtils.cpp
+++ b/gfx/src/gfxCrashReporterUtils.cpp
@@ -27,7 +27,7 @@
 namespace mozilla {
 
 static nsTArray<nsCString>* gFeaturesAlreadyReported = nullptr;
-static StaticMutex gFeaturesAlreadyReportedMutex;
+static StaticMutex gFeaturesAlreadyReportedMutex MOZ_UNANNOTATED;
 
 class ObserverToDestroyFeaturesAlreadyReported final : public nsIObserver {
  public:
diff --git a/gfx/tests/gtest/TestVsync.cpp b/gfx/tests/gtest/TestVsync.cpp
index 05b23d0d0bd72..94eb354c8a7c2 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;
+  Monitor mVsyncMonitor MOZ_UNANNOTATED;
 };
 
 class VsyncTester : public ::testing::Test {
diff --git a/gfx/thebes/DeviceManagerDx.h b/gfx/thebes/DeviceManagerDx.h
index f33db20bdf361..9e3187877a398 100644
--- a/gfx/thebes/DeviceManagerDx.h
+++ b/gfx/thebes/DeviceManagerDx.h
@@ -172,7 +172,7 @@ class DeviceManagerDx final {
 
   nsModuleHandle mDcompModule;
 
-  mozilla::Mutex mDeviceLock;
+  mozilla::Mutex mDeviceLock MOZ_UNANNOTATED;
   nsTArray<D3D_FEATURE_LEVEL> mFeatureLevels;
   RefPtr<IDXGIAdapter1> mAdapter;
   RefPtr<ID3D11Device> mCompositorDevice;
diff --git a/gfx/thebes/VsyncSource.h b/gfx/thebes/VsyncSource.h
index 7006e14ea8ab4..fefd04486920d 100644
--- a/gfx/thebes/VsyncSource.h
+++ b/gfx/thebes/VsyncSource.h
@@ -94,7 +94,7 @@ class VsyncSource {
  private:
   void UpdateVsyncStatus();
 
-  Mutex mDispatcherLock;
+  Mutex mDispatcherLock MOZ_UNANNOTATED;
   bool mRefreshTimerNeedsVsync;
   nsTArray<RefPtr<CompositorVsyncDispatcher>>
       mEnabledCompositorVsyncDispatchers;
diff --git a/gfx/thebes/gfxDWriteCommon.cpp b/gfx/thebes/gfxDWriteCommon.cpp
index 3092ba3e222fd..ee81f15680ef5 100644
--- a/gfx/thebes/gfxDWriteCommon.cpp
+++ b/gfx/thebes/gfxDWriteCommon.cpp
@@ -13,7 +13,7 @@
 
 class gfxDWriteFontFileStream;
 
-static mozilla::StaticMutex sFontFileStreamsMutex;
+static mozilla::StaticMutex sFontFileStreamsMutex MOZ_UNANNOTATED;
 static uint64_t sNextFontFileKey = 0;
 static std::unordered_map<uint64_t, gfxDWriteFontFileStream*> sFontFileStreams;
 
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 3f6491e9763ed..2f14ed83d8596 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 CrashStatsLogForwarder::CrashStatsLogForwarder(CrashReporter::Annotation aKey)
diff --git a/gfx/thebes/gfxPlatformFontList.h b/gfx/thebes/gfxPlatformFontList.h
index 6fa68cc906fe8..3bfef70d5cadf 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;
+  mozilla::Mutex mFontFamiliesMutex MOZ_UNANNOTATED;
 
   // 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 f17beac6ec887..35d9cdeba4f12 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<gl::GLContextGLX> mGLContext;
   _XDisplay* mXDisplay;
-  Monitor mSetupLock;
+  Monitor mSetupLock MOZ_UNANNOTATED;
   base::Thread mVsyncThread;
   RefPtr<Runnable> mVsyncTask;
-  Monitor mVsyncEnabledLock;
+  Monitor mVsyncEnabledLock MOZ_UNANNOTATED;
   bool mVsyncEnabled;
 };
 
diff --git a/gfx/vr/VRManager.h b/gfx/vr/VRManager.h
index 09768ba0e3015..c7a5bb5f0d184 100644
--- a/gfx/vr/VRManager.h
+++ b/gfx/vr/VRManager.h
@@ -159,7 +159,7 @@ class VRManager : nsIObserver {
   bool mFrameStarted;
   uint32_t mTaskInterval;
   RefPtr<nsITimer> mTaskTimer;
-  mozilla::Monitor mCurrentSubmitTaskMonitor;
+  mozilla::Monitor mCurrentSubmitTaskMonitor MOZ_UNANNOTATED;
   RefPtr<CancelableRunnable> mCurrentSubmitTask;
   uint64_t mLastSubmittedFrameId;
   uint64_t mLastStartedFrame;
diff --git a/gfx/vr/VRPuppetCommandBuffer.h b/gfx/vr/VRPuppetCommandBuffer.h
index 6acbcbe80dcaa..baa3063c9a98e 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<uint64_t> mBuffer;
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   VRSystemState mPendingState;
   VRSystemState mCommittedState;
   double mHapticPulseRemaining[kVRControllerMaxCount][kNumPuppetHaptics];
diff --git a/gfx/vr/service/OpenVRSession.h b/gfx/vr/service/OpenVRSession.h
index 60ddcf4b290cd..dc58b5d7fd0eb 100644
--- a/gfx/vr/service/OpenVRSession.h
+++ b/gfx/vr/service/OpenVRSession.h
@@ -102,7 +102,7 @@ class OpenVRSession : public VRSession {
   void StopHapticTimer();
   RefPtr<nsITimer> mHapticTimer;
   RefPtr<VRThread> mHapticThread;
-  mozilla::Mutex mControllerHapticStateMutex;
+  mozilla::Mutex mControllerHapticStateMutex MOZ_UNANNOTATED;
   UniquePtr<OpenVRControllerMapper> mControllerMapper;
 };
 
diff --git a/gfx/webrender_bindings/RenderThread.h b/gfx/webrender_bindings/RenderThread.h
index 8b5b9ff7f551c..1b935505761ba 100644
--- a/gfx/webrender_bindings/RenderThread.h
+++ b/gfx/webrender_bindings/RenderThread.h
@@ -360,7 +360,7 @@ class RenderThread final {
     }
   };
 
-  Mutex mRenderTextureMapLock;
+  Mutex mRenderTextureMapLock MOZ_UNANNOTATED;
   std::unordered_map<wr::ExternalImageId, RefPtr<RenderTextureHost>,
                      ExternalImageIdHashFn>
       mRenderTextures;
diff --git a/image/AnimationSurfaceProvider.h b/image/AnimationSurfaceProvider.h
index b104049afa71d..920638279ec24 100644
--- a/image/AnimationSurfaceProvider.h
+++ b/image/AnimationSurfaceProvider.h
@@ -113,13 +113,13 @@ class AnimationSurfaceProvider final : public ISurfaceProvider,
   RefPtr<RasterImage> mImage;
 
   /// A mutex to protect mDecoder. Always taken before mFramesMutex.
-  mutable Mutex mDecodingMutex;
+  mutable Mutex mDecodingMutex MOZ_UNANNOTATED;
 
   /// The decoder used to decode this animation.
   RefPtr<Decoder> mDecoder;
 
   /// A mutex to protect mFrames. Always taken after mDecodingMutex.
-  mutable Mutex mFramesMutex;
+  mutable Mutex mFramesMutex MOZ_UNANNOTATED;
 
   /// The frames of this animation, in order.
   UniquePtr<AnimationFrameBuffer> mFrames;
diff --git a/image/DecodePool.h b/image/DecodePool.h
index cbbcdd784a7ef..3ce1bf943017e 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   nsCOMPtr<nsIThread> mIOThread;
 };
 
diff --git a/image/DecodedSurfaceProvider.h b/image/DecodedSurfaceProvider.h
index a00a746001a64..07e722daa6edc 100644
--- a/image/DecodedSurfaceProvider.h
+++ b/image/DecodedSurfaceProvider.h
@@ -75,7 +75,7 @@ class DecodedSurfaceProvider final : public ISurfaceProvider,
   RefPtr<RasterImage> mImage;
 
   /// Mutex protecting access to mDecoder.
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   /// The decoder that will generate our surface. Dropped after decoding.
   RefPtr<Decoder> mDecoder;
diff --git a/image/IDecodingTask.h b/image/IDecodingTask.h
index d4199dbcfbf7b..b3bce74757e4c 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   NotNull<RefPtr<Decoder>> mDecoder;
 };
diff --git a/image/ProgressTracker.h b/image/ProgressTracker.h
index 4c9b9b3e578c2..568fb5e28c265 100644
--- a/image/ProgressTracker.h
+++ b/image/ProgressTracker.h
@@ -226,7 +226,7 @@ class ProgressTracker : public mozilla::SupportsWeakPtr {
   RefPtr<RenderBlockingRunnable> mRunnable;
 
   // mMutex protects access to mImage and mEventTarget.
-  mutable Mutex mMutex;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 c218edda93e1b..55d974636335d 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;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
 
   /// The data in this SourceBuffer, stored as a series of Chunks.
   AutoTArray<Chunk, 1> mChunks;
diff --git a/image/SurfaceCache.cpp b/image/SurfaceCache.cpp
index 95ac62c627a8c..36dc579048b5d 100644
--- a/image/SurfaceCache.cpp
+++ b/image/SurfaceCache.cpp
@@ -60,7 +60,7 @@ class SurfaceCacheImpl;
 static StaticRefPtr<SurfaceCacheImpl> sInstance;
 
 // The mutex protecting the surface cache.
-static StaticMutex sInstanceMutex;
+static StaticMutex sInstanceMutex MOZ_UNANNOTATED;
 
 ///////////////////////////////////////////////////////////////////////////////
 // SurfaceCache Implementation
diff --git a/image/encoders/jpeg/nsJPEGEncoder.h b/image/encoders/jpeg/nsJPEGEncoder.h
index e0c17ef624adf..df543d957b64c 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;
+  ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
 };
 
 #endif  // mozilla_image_encoders_jpeg_nsJPEGEncoder_h
diff --git a/image/encoders/png/nsPNGEncoder.h b/image/encoders/png/nsPNGEncoder.h
index c73d8a62b6536..76d695ccfae1f 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;
+  ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
 };
 #endif  // mozilla_image_encoders_png_nsPNGEncoder_h
diff --git a/image/encoders/webp/nsWebPEncoder.h b/image/encoders/webp/nsWebPEncoder.h
index 0fb8f1bfd8b00..8628d12388ae0 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;
+  ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
 };
 #endif  // mozilla_image_encoders_webp_nsWebPEncoder_h
diff --git a/image/imgFrame.h b/image/imgFrame.h
index a1c7979fc5b57..4ecb9e0d72993 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;
+  mutable Monitor mMonitor MOZ_UNANNOTATED;
 
   /**
    * Used for rasterized images, this contains the raw pixel data.
diff --git a/image/imgLoader.h b/image/imgLoader.h
index 05ff6dba7ec00..9b3515a9066a3 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;
+  Mutex mUncachedImagesMutex MOZ_UNANNOTATED;
 
   static double sCacheTimeWeight;
   static uint32_t sCacheMaxSize;
diff --git a/image/imgRequest.h b/image/imgRequest.h
index e372940435e80..e3ac3cb84b9ff 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;
+  mutable mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 7579ae9b2e38a..0e8a277b1feac 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   nsCOMPtr<nsIStringBundle> 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 c5a847b7c7a26..0a8a7b62f4f38 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   bool mAttemptedLoad;
   bool mLoaded;
 
diff --git a/ipc/chromium/gtest/ports_unittest.cc b/ipc/chromium/gtest/ports_unittest.cc
index 39b556253fcb2..b99ddd78e0984 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_{"TestNode"};
+  mozilla::Mutex lock_ MOZ_UNANNOTATED{"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_{"PortsTest Global Lock"};
+  mozilla::Mutex global_lock_ MOZ_UNANNOTATED{"PortsTest Global Lock"};
 
-  mozilla::Mutex lock_{"PortsTest Lock"};
+  mozilla::Mutex lock_ MOZ_UNANNOTATED{"PortsTest Lock"};
   std::map<NodeName, TestNode*> nodes_;
 };
 
diff --git a/ipc/chromium/src/base/at_exit.h b/ipc/chromium/src/base/at_exit.h
index 6e3d0bed2a8cd..f0c0a63114689 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_;
+  mozilla::Mutex lock_ MOZ_UNANNOTATED;
   std::stack<CallbackAndParam> 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 dfa43300eac0a..22f823d04eea9 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   MessageLoop* mLoop;
 };
 
diff --git a/ipc/chromium/src/base/message_loop.h b/ipc/chromium/src/base/message_loop.h
index bbfbac6f45d8a..9c45fbfdfc6f0 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_;
+  mozilla::Mutex incoming_queue_lock_ MOZ_UNANNOTATED;
 
   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 0f52a6ebd7bf8..c3e8651430129 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;
+    static mozilla::StaticMutex mutex MOZ_UNANNOTATED;
     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 d31b6dfba127b..fbbc8f65f7bf6 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_{"Ports Lock"};
+  mozilla::Mutex ports_lock_ MOZ_UNANNOTATED{"Ports Lock"};
   std::unordered_map<LocalPortName, RefPtr<Port>> 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 b74c23f00b6ab..a54d99863237a 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_{"Port State"};
+  mozilla::Mutex lock_ MOZ_UNANNOTATED{"Port State"};
 };
 
 }  // namespace ports
diff --git a/ipc/glue/BrowserProcessSubThread.h b/ipc/glue/BrowserProcessSubThread.h
index 03e56f617f550..6397f42d205eb 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;
+  static StaticMutex sLock MOZ_UNANNOTATED;
 
   // 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 b771dcb7a2004..e47ec94bd7f09 100644
--- a/ipc/glue/CrashReporterClient.h
+++ b/ipc/glue/CrashReporterClient.h
@@ -40,7 +40,7 @@ class CrashReporterClient {
   ~CrashReporterClient();
 
  private:
-  static StaticMutex sLock;
+  static StaticMutex sLock MOZ_UNANNOTATED;
   static StaticRefPtr<CrashReporterClient> sClientSingleton;
 };
 
diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
index 4e4cfd0bfa792..fb778c85d2ffc 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;
+static mozilla::StaticMutex gIPCLaunchThreadMutex MOZ_UNANNOTATED;
 static mozilla::StaticRefPtr<nsIThread> gIPCLaunchThread;
 
 class IPCLaunchThreadObserver final : public nsIObserver {
diff --git a/ipc/glue/GeckoChildProcessHost.h b/ipc/glue/GeckoChildProcessHost.h
index a586b829b3099..f55de551b05cc 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
   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<LinkedList<GeckoChildProcessHost>>
       sGeckoChildProcessHosts;
-  static StaticMutex sMutex;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
 };
 
 nsCOMPtr<nsIEventTarget> GetIPCLauncher();
diff --git a/ipc/glue/IPCStreamDestination.cpp b/ipc/glue/IPCStreamDestination.cpp
index c6c87cbc3811e..16653cd489be9 100644
--- a/ipc/glue/IPCStreamDestination.cpp
+++ b/ipc/glue/IPCStreamDestination.cpp
@@ -185,7 +185,7 @@ class IPCStreamDestination::DelayedStartInputStream final
   nsCOMPtr<nsIInputStreamCallback> mAsyncWaitCallback;
 
   // This protects mDestination: any method can be called by any thread.
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   class HelperRunnable;
 };
diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp
index bf1d941ba33a6..ef3ac6dd839fc 100644
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -346,7 +346,7 @@ class ChannelCountReporter final : public nsIMemoryReporter {
 
   using CountTable = nsTHashMap<nsDepCharHashKey, ChannelCounts>;
 
-  static StaticMutex sChannelCountMutex;
+  static StaticMutex sChannelCountMutex MOZ_UNANNOTATED;
   static CountTable* sChannelCounts;
 
  public:
diff --git a/ipc/glue/MessagePump.h b/ipc/glue/MessagePump.h
index 0b7ff11902bf4..162aba83d6c4f 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;
+  mozilla::Mutex mWaitLock MOZ_UNANNOTATED;
 };
 #endif  // defined(XP_WIN)
 
diff --git a/ipc/ipdl/test/cxx/TestCrashCleanup.cpp b/ipc/ipdl/test/cxx/TestCrashCleanup.cpp
index 6807bd296dc77..6a19cc0f65651 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("TestCrashCleanup.DeleteTheWorld.mutex");
+  Mutex mutex MOZ_UNANNOTATED("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 30a90e8928b66..3af7ad620d925 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("TestInterruptErrorCleanup.DeleteTheWorld.mutex");
+  Mutex mutex MOZ_UNANNOTATED("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 60fc7f92c6bd9..259d672683b6e 100644
--- a/ipc/mscom/Interceptor.cpp
+++ b/ipc/mscom/Interceptor.cpp
@@ -64,7 +64,7 @@ class LiveSet final {
   }
 
  private:
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   nsRefPtrHashtable<nsPtrHashKey<IUnknown>, IWeakReference> mLiveSet;
 };
 
diff --git a/ipc/mscom/Interceptor.h b/ipc/mscom/Interceptor.h
index d61c21f1ea3ad..8ab578092bd3f 100644
--- a/ipc/mscom/Interceptor.h
+++ b/ipc/mscom/Interceptor.h
@@ -167,10 +167,12 @@ class Interceptor final : public WeakReferenceSupport,
  private:
   InterceptorTargetPtr<IUnknown> mTarget;
   RefPtr<IInterceptorSink> mEventSink;
-  mozilla::Mutex mInterceptorMapMutex;  // Guards mInterceptorMap
+  mozilla::Mutex mInterceptorMapMutex
+      MOZ_UNANNOTATED;  // Guards mInterceptorMap
   // Using a nsTArray since the # of interfaces is not going to be very high
   nsTArray<MapEntry> mInterceptorMap;
-  mozilla::Mutex mStdMarshalMutex;  // Guards mStdMarshalUnk and mStdMarshal
+  mozilla::Mutex mStdMarshalMutex
+      MOZ_UNANNOTATED;  // Guards mStdMarshalUnk and mStdMarshal
   RefPtr<IUnknown> mStdMarshalUnk;
   IMarshal* mStdMarshal;  // WEAK
   static MOZ_THREAD_LOCAL(bool) tlsCreatingStdMarshal;
diff --git a/ipc/mscom/InterceptorLog.cpp b/ipc/mscom/InterceptorLog.cpp
index 6d0bdb31ca8a7..ffd82c8a1dc36 100644
--- a/ipc/mscom/InterceptorLog.cpp
+++ b/ipc/mscom/InterceptorLog.cpp
@@ -92,7 +92,7 @@ class Logger final {
 
   nsCOMPtr<nsIFile> mLogFileName;
   nsCOMPtr<nsIOutputStream> mLogFile;  // Only accessed by mThread
-  Mutex mMutex;                        // Guards mThread and mEntries
+  Mutex mMutex MOZ_UNANNOTATED;        // Guards mThread and mEntries
   nsCOMPtr<nsIThread> mThread;
   nsTArray<nsCString> mEntries;
 };
diff --git a/js/src/ds/MemoryProtectionExceptionHandler.cpp b/js/src/ds/MemoryProtectionExceptionHandler.cpp
index e4e2332aa4496..ef05d7baf8175 100644
--- a/js/src/ds/MemoryProtectionExceptionHandler.cpp
+++ b/js/src/ds/MemoryProtectionExceptionHandler.cpp
@@ -67,7 +67,7 @@ class ProtectedRegionTree {
     }
   };
 
-  Mutex lock;
+  Mutex lock MOZ_UNANNOTATED;
   LifoAlloc alloc;
   SplayTree<Region, Region> tree;
 
diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h
index 01d1f949b1ab9..afaa5fab4a482 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;
+  js::Mutex lock MOZ_UNANNOTATED;
 
   friend class BackgroundSweepTask;
   friend class BackgroundFreeTask;
diff --git a/js/src/gc/Scheduling.h b/js/src/gc/Scheduling.h
index c9586d243078b..8040645c0aafe 100644
--- a/js/src/gc/Scheduling.h
+++ b/js/src/gc/Scheduling.h
@@ -945,7 +945,7 @@ class MemoryTracker {
 
   size_t getAndRemoveEntry(const Key<Cell>& key, LockGuard<Mutex>& lock);
 
-  Mutex mutex;
+  Mutex mutex MOZ_UNANNOTATED;
 
   // 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 f1f309eab2cf9..e93056b3586e9 100644
--- a/js/src/gc/StoreBuffer.h
+++ b/js/src/gc/StoreBuffer.h
@@ -441,7 +441,7 @@ class StoreBuffer {
     }
   }
 
-  Mutex lock_;
+  Mutex lock_ MOZ_UNANNOTATED;
 
   MonoTypeBuffer<ValueEdge> bufferVal;
   MonoTypeBuffer<StringPtrEdge> bufStrCell;
diff --git a/js/src/jit/CacheIRSpewer.h b/js/src/jit/CacheIRSpewer.h
index 9cf1505450f71..fba33ba990e3b 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_;
+  Mutex outputLock_ MOZ_UNANNOTATED;
   Fprinter output_;
   mozilla::Maybe<JSONPrinter> json_;
   static CacheIRSpewer cacheIRspewer;
diff --git a/js/src/jit/JitSpewer.cpp b/js/src/jit/JitSpewer.cpp
index 6713cafa818f4..d85fbcf3d39f6 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_;
+  Mutex outputLock_ MOZ_UNANNOTATED;
   Fprinter jsonOutput_;
   bool firstFunction_;
   bool asyncLogging_;
diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp
index 60f60db7bd15d..5ea4b2e4ca5b4 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_;
+  Mutex lock_ MOZ_UNANNOTATED;
 
   // 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 eb4312e444424..fba0f8ce5e00d 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_;
+  Mutex cacheLock_ MOZ_UNANNOTATED;
 
   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 f7fd41c569c68..a0515bee062d9 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_;
+  js::Mutex lock_ MOZ_UNANNOTATED;
   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 79acef3e63356..7ab204af543f4 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_;
+  Mutex cacheLock_ MOZ_UNANNOTATED;
 
   Redirection* redirection_;
   ICacheMap icache_;
diff --git a/js/src/jit/mips64/Simulator-mips64.h b/js/src/jit/mips64/Simulator-mips64.h
index 8f436fb38ad48..02b2774f24deb 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_;
+  Mutex cacheLock_ MOZ_UNANNOTATED;
 
   Redirection* redirection_;
   ICacheMap icache_;
diff --git a/js/src/jsapi-tests/testCompileNonSyntactic.cpp b/js/src/jsapi-tests/testCompileNonSyntactic.cpp
index c3115e65c5abc..34893279e8772 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;
+  js::Monitor monitor MOZ_UNANNOTATED;
   OffThreadToken* token;
 };
 
diff --git a/js/src/jsapi-tests/testScriptSourceCompression.cpp b/js/src/jsapi-tests/testScriptSourceCompression.cpp
index ea3ce07cc0413..5089930a077ab 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<char16_t> source;
   CHECK(source.init(cx, std::move(chars), len));
 
-  js::Monitor monitor(js::mutexid::ShellOffThreadState);
+  js::Monitor monitor MOZ_UNANNOTATED(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 32e4d8bf85e91..12b6499f40348 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<mozilla::Utf8Unit> srcBuf;
   CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed));
 
-  js::Monitor monitor(js::mutexid::ShellOffThreadState);
+  js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState);
   JS::CompileOptions options(cx);
   JS::OffThreadToken* token;
 
@@ -383,7 +383,7 @@ BEGIN_TEST(testStencil_OffThreadWithInstantiationStorage) {
   JS::SourceText<mozilla::Utf8Unit> srcBuf;
   CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed));
 
-  js::Monitor monitor(js::mutexid::ShellOffThreadState);
+  js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState);
   JS::CompileOptions options(cx);
   JS::OffThreadToken* token;
 
@@ -435,7 +435,7 @@ BEGIN_TEST(testStencil_OffThreadModule) {
   JS::SourceText<mozilla::Utf8Unit> srcBuf;
   CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed));
 
-  js::Monitor monitor(js::mutexid::ShellOffThreadState);
+  js::Monitor monitor MOZ_UNANNOTATED(js::mutexid::ShellOffThreadState);
   JS::CompileOptions options(cx);
   JS::OffThreadToken* token;
 
@@ -487,7 +487,7 @@ BEGIN_TEST(testStencil_OffThreadModuleWithInstantiationStorage) {
   JS::SourceText<mozilla::Utf8Unit> srcBuf;
   CHECK(srcBuf.init(cx, chars, strlen(chars), JS::SourceOwnership::Borrowed));
 
-  js::Monitor monitor(js::mutexid::ShellOffThreadState);
+  js::Monitor monitor MOZ_UNANNOTATED(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(js::mutexid::ShellOffThreadState);
+    js::Monitor monitor MOZ_UNANNOTATED(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(js::mutexid::ShellOffThreadState);
+    js::Monitor monitor MOZ_UNANNOTATED(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(js::mutexid::ShellOffThreadState);
+    js::Monitor monitor MOZ_UNANNOTATED(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(js::mutexid::ShellOffThreadState);
+    js::Monitor monitor MOZ_UNANNOTATED(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 3f934838a6330..1bff19437210f 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;
+  js::Mutex mutex MOZ_UNANNOTATED;
   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 019f1aaa0e27e..e3d2f1155ded6 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(js::mutexid::TestMutex);
+  js::Mutex mutex MOZ_UNANNOTATED(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(js::mutexid::TestMutex);
+  js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex);
   js::LockGuard<js::Mutex> guard(mutex);
   return true;
 }
 END_TEST(testThreadingLockGuard)
 
 BEGIN_TEST(testThreadingUnlockGuard) {
-  js::Mutex mutex(js::mutexid::TestMutex);
+  js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex);
   js::LockGuard<js::Mutex> guard(mutex);
   js::UnlockGuard<js::Mutex> unguard(guard);
   return true;
diff --git a/js/src/shell/jsshell.h b/js/src/shell/jsshell.h
index 12240229de823..71d3f5c37d383 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;
+  js::Mutex watchdogLock MOZ_UNANNOTATED;
   js::ConditionVariable watchdogWakeup;
   mozilla::Maybe<js::Thread> watchdogThread;
   mozilla::Maybe<mozilla::TimeStamp> watchdogTimeout;
@@ -252,7 +252,7 @@ struct ShellContext {
   UniquePtr<MarkBitObservers> markObservers;
 
   // Off-thread parse state.
-  js::Monitor offThreadMonitor;
+  js::Monitor offThreadMonitor MOZ_UNANNOTATED;
   Vector<OffThreadJob*, 0, SystemAllocPolicy> offThreadJobs;
 
   // Queued finalization registry cleanup jobs.
diff --git a/js/src/threading/ExclusiveData.h b/js/src/threading/ExclusiveData.h
index 5869431667994..38e89f10a1d3b 100644
--- a/js/src/threading/ExclusiveData.h
+++ b/js/src/threading/ExclusiveData.h
@@ -84,7 +84,7 @@ namespace js {
 template <typename T>
 class ExclusiveData {
  protected:
-  mutable Mutex lock_;
+  mutable Mutex lock_ MOZ_UNANNOTATED;
   mutable T value_;
 
   ExclusiveData(const ExclusiveData&) = delete;
@@ -280,7 +280,7 @@ class ExclusiveWaitableData : public ExclusiveData<T> {
  */
 template <typename T>
 class RWExclusiveData {
-  mutable Mutex lock_;
+  mutable Mutex lock_ MOZ_UNANNOTATED;
   mutable ConditionVariable cond_;
   mutable T value_;
   mutable int readers_;
diff --git a/js/src/threading/Thread.h b/js/src/threading/Thread.h
index 4166fbb8b34c6..f21b667dff97a 100644
--- a/js/src/threading/Thread.h
+++ b/js/src/threading/Thread.h
@@ -188,7 +188,7 @@ class ThreadTrampoline {
   mozilla::Tuple<std::decay_t<Args>...> args;
 
   // Protect the thread id during creation.
-  Mutex createMutex;
+  Mutex createMutex MOZ_UNANNOTATED;
 
   // Thread can access createMutex.
   friend class js::Thread;
diff --git a/js/src/vm/HelperThreads.h b/js/src/vm/HelperThreads.h
index cf8fb87aa7c21..60fbf70dab2b5 100644
--- a/js/src/vm/HelperThreads.h
+++ b/js/src/vm/HelperThreads.h
@@ -60,7 +60,7 @@ using UniqueTier2GeneratorTask = UniquePtr<Tier2GeneratorTask>;
  * Lock protecting all mutable shared state accessed by helper threads, and used
  * by all condition variables.
  */
-extern Mutex gHelperThreadLock;
+extern Mutex gHelperThreadLock MOZ_UNANNOTATED;
 
 class MOZ_RAII AutoLockHelperThreadState : public LockGuard<Mutex> {
   using Base = LockGuard<Mutex>;
diff --git a/js/src/vm/Monitor.h b/js/src/vm/Monitor.h
index 9535f7a629584..5bc1b141ae7bd 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_;
+  Mutex lock_ MOZ_UNANNOTATED;
   ConditionVariable condVar_;
 
  public:
diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h
index 16bb7172819e9..cff07be2a0884 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;
+  js::Mutex scriptDataLock MOZ_UNANNOTATED;
 #ifdef DEBUG
   bool activeThreadHasScriptDataAccess;
 #endif
diff --git a/js/src/vm/SharedArrayObject.h b/js/src/vm/SharedArrayObject.h
index 1c190e8554ce1..353f767ef2312 100644
--- a/js/src/vm/SharedArrayObject.h
+++ b/js/src/vm/SharedArrayObject.h
@@ -50,7 +50,7 @@ class SharedArrayRawBuffer {
  private:
   mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> refcount_;
   mozilla::Atomic<size_t, mozilla::SequentiallyConsistent> length_;
-  Mutex growLock_;
+  Mutex growLock_ MOZ_UNANNOTATED;
   // 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 31a48d1a462af..3ca5b5d592a2d 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;
+  Mutex lock MOZ_UNANNOTATED;
 
   TraceLoggerThreadState() : lock(js::mutexid::TraceLoggerThreadState) {}
 
diff --git a/js/src/vm/TraceLoggingGraph.h b/js/src/vm/TraceLoggingGraph.h
index 39ddee03e9607..458ff484e7e36 100644
--- a/js/src/vm/TraceLoggingGraph.h
+++ b/js/src/vm/TraceLoggingGraph.h
@@ -82,7 +82,7 @@ class TraceLoggerGraphState {
 #endif
 
  public:
-  js::Mutex lock;
+  js::Mutex lock MOZ_UNANNOTATED;
 
  public:
   TraceLoggerGraphState()
diff --git a/js/src/wasm/WasmProcess.cpp b/js/src/wasm/WasmProcess.cpp
index 844461010c224..32d84a5919e79 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_;
+  Mutex mutatorsMutex_ MOZ_UNANNOTATED;
 
   CodeSegmentVector segments1_;
   CodeSegmentVector segments2_;
diff --git a/js/xpconnect/loader/ScriptPreloader.h b/js/xpconnect/loader/ScriptPreloader.h
index f443df6863245..c41801953cd04 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;
-  Monitor mSaveMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
+  Monitor mSaveMonitor MOZ_UNANNOTATED;
 };
 
 }  // namespace mozilla
diff --git a/js/xpconnect/loader/URLPreloader.h b/js/xpconnect/loader/URLPreloader.h
index dc9b41f011beb..54a8eb266ae41 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{"[URLPreloader::mMutex]"};
+  Monitor mMonitor MOZ_UNANNOTATED{"[URLPreloader::mMutex]"};
 };
 
 }  // namespace mozilla
diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp
index 1cfd467a96d0d..b7d5f20688a31 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   CondVar mCondVar;
   bool mWaiting;
 
diff --git a/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp b/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp
index e954a8b54935c..cf590b39c467f 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   MediaTrackListener* mListener = nullptr;
   nsCOMPtr<nsITimer> mTimer;
   int mCount = 0;
diff --git a/memory/build/Mutex.h b/memory/build/Mutex.h
index 0a1d7631a3661..37c39045ed981 100644
--- a/memory/build/Mutex.h
+++ b/memory/build/Mutex.h
@@ -122,4 +122,12 @@ struct MOZ_RAII AutoLock {
 
 using MutexAutoLock = AutoLock<Mutex>;
 
+// 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 bce1b2637e1f0..c20d273da6084 100644
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -631,7 +631,7 @@ static bool malloc_initialized;
 static Atomic<bool, SequentiallyConsistent> malloc_initialized;
 #endif
 
-static StaticMutex gInitLock = {STATIC_MUTEX_INIT};
+static StaticMutex gInitLock MOZ_UNANNOTATED = {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;
+  Mutex mLock MOZ_UNANNOTATED;
   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;
+  Mutex mLock MOZ_UNANNOTATED;
 
   arena_stats_t mStats;
 
@@ -1204,7 +1204,7 @@ class ArenaCollection {
 
   inline arena_t* GetDefault() { return mDefaultArena; }
 
-  Mutex mLock;
+  Mutex mLock MOZ_UNANNOTATED;
 
  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;
+static Mutex chunks_mtx MOZ_UNANNOTATED;
 
 // 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<extent_node_t, ExtentTreeSzTrait> gChunksBySize;
 static RedBlackTree<extent_node_t, ExtentTreeTrait> gChunksByAddress;
 
 // Protects huge allocation-related data structures.
-static Mutex huge_mtx;
+static Mutex huge_mtx MOZ_UNANNOTATED;
 
 // Tree of chunks that are stand-alone huge allocations.
 static RedBlackTree<extent_node_t, ExtentTreeTrait> 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;
+static Mutex base_mtx MOZ_UNANNOTATED;
 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 8d6aad0675b1c..800aefad6a937 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;
+static Mutex sMutex MOZ_UNANNOTATED;
 
 #ifndef _WIN32
 static void prefork() { sMutex.Lock(); }
diff --git a/memory/replace/phc/PHC.cpp b/memory/replace/phc/PHC.cpp
index bec19de51b85d..59e5893bb1abd 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;
+  static Mutex sMutex MOZ_UNANNOTATED;
 
   GMut()
       : mRNG(RandomSeed<0>(), RandomSeed<1>()),
diff --git a/memory/volatile/VolatileBuffer.h b/memory/volatile/VolatileBuffer.h
index 26c2457e43a03..badd7f3cec5ee 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   void* mBuf;
   size_t mSize;
diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h
index 21a3fc04fcfe3..b871c8e6393f1 100644
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -683,6 +683,13 @@
  * 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
@@ -768,6 +775,13 @@
       __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
@@ -821,6 +835,8 @@
 #    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 88abf6119ac4b..fdca03d474a34 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;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
   uint32_t mCacheSize;
   ZipsHashtable mZips;
 
diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp
index 5557b62336171..2a751f5af6c81 100644
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -141,7 +141,7 @@ class ZipArchiveLogger {
   }
 
  private:
-  static StaticMutex sLock;
+  static StaticMutex sLock MOZ_UNANNOTATED;
   int mRefCnt;
   PRFileDesc* mFd;
 };
diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
index 6b108298edf57..fa88d4b4ec18a 100644
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -3011,7 +3011,7 @@ class PreferencesWriter final {
   static Atomic<int> sPendingWriteCount;
 
   // See PWRunnable::Run for details on why we need this lock.
-  static StaticMutex sWritingToFile;
+  static StaticMutex sWritingToFile MOZ_UNANNOTATED;
 };
 
 Atomic<PrefSaveData*> PreferencesWriter::sPendingWriteData(nullptr);
@@ -5360,7 +5360,7 @@ static void InitAlwaysPref(const nsCString& aName, T* aCache,
 }
 
 static Atomic<bool> sOncePrefRead(false);
-static StaticMutex sOncePrefMutex;
+static StaticMutex sOncePrefMutex MOZ_UNANNOTATED;
 
 namespace StaticPrefs {
 
diff --git a/mozglue/misc/AutoProfilerLabel.cpp b/mozglue/misc/AutoProfilerLabel.cpp
index 9bfdc19ef76ec..c07ea084dcf61 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;
+  static Mutex sAPLMutex MOZ_UNANNOTATED;
 
   static ProfilerLabelEnter sEnter;
   static ProfilerLabelExit sExit;
diff --git a/mozglue/misc/PlatformMutex.h b/mozglue/misc/PlatformMutex.h
index 9792b006ba2be..ac5459cf1033f 100644
--- a/mozglue/misc/PlatformMutex.h
+++ b/mozglue/misc/PlatformMutex.h
@@ -63,5 +63,4 @@ class MutexImpl {
 }  // namespace detail
 
 }  // namespace mozilla
-
 #endif  // mozilla_PlatformMutex_h
diff --git a/netwerk/base/AutoClose.h b/netwerk/base/AutoClose.h
index 632b29ed7b549..a0e3a48e17fd3 100644
--- a/netwerk/base/AutoClose.h
+++ b/netwerk/base/AutoClose.h
@@ -53,7 +53,7 @@ class AutoClose {
   AutoClose(const AutoClose<T>&) = delete;
 
   nsCOMPtr<T> mPtr;
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace net
diff --git a/netwerk/base/BackgroundFileSaver.h b/netwerk/base/BackgroundFileSaver.h
index 5edce2e1d65cd..61e52f8c49773 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{"BackgroundFileSaver.mLock"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"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 4179397b0f75f..1112a013e9d89 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<LogData> data;
-    mozilla::Mutex lock;
+    mozilla::Mutex lock MOZ_UNANNOTATED;
   };
 
   bool mEnableLogging;
diff --git a/netwerk/base/IOActivityMonitor.h b/netwerk/base/IOActivityMonitor.h
index 998049a9dbc2a..9a0186c8ada84 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;
+  Mutex mLock MOZ_UNANNOTATED;
 };
 
 }  // namespace net
diff --git a/netwerk/base/NetworkConnectivityService.h b/netwerk/base/NetworkConnectivityService.h
index e0f6634471b62..d999309339006 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;
+  Mutex mLock MOZ_UNANNOTATED;
 };
 
 }  // namespace net
diff --git a/netwerk/base/PartiallySeekableInputStream.h b/netwerk/base/PartiallySeekableInputStream.h
index 92ad4114c5227..b2cc150fd3e34 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace net
diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp
index 299e98cba05d9..8a1e1a3559b69 100644
--- a/netwerk/base/ProxyAutoConfig.cpp
+++ b/netwerk/base/ProxyAutoConfig.cpp
@@ -132,7 +132,7 @@ class PACResolver final : public nsIDNSListener,
   nsCOMPtr<nsIDNSRecord> mResponse;
   nsCOMPtr<nsITimer> mTimer;
   nsCOMPtr<nsIEventTarget> mMainThreadEventTarget;
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
  private:
   ~PACResolver() = default;
diff --git a/netwerk/base/RedirectChannelRegistrar.h b/netwerk/base/RedirectChannelRegistrar.h
index a651e4065068e..3b8f283ee750e 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;
+  Mutex mLock MOZ_UNANNOTATED;
 
   static StaticRefPtr<RedirectChannelRegistrar> gSingleton;
 };
diff --git a/netwerk/base/SSLTokensCache.h b/netwerk/base/SSLTokensCache.h
index 6a41c39f0ca13..22f622504d606 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<SSLTokensCache> gInstance;
-  static StaticMutex sLock;
+  static StaticMutex sLock MOZ_UNANNOTATED;
 
   uint32_t mCacheSize{0};  // Actual cache size in bytes
 
diff --git a/netwerk/base/TLSServerSocket.h b/netwerk/base/TLSServerSocket.h
index be8dd22d3e5d5..36cb292c88a11 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{"TLSServerConnectionInfo.mLock"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"TLSServerConnectionInfo.mLock"};
   nsCOMPtr<nsITLSServerSecurityObserver> mSecurityObserver;
 };
 
diff --git a/netwerk/base/Tickler.h b/netwerk/base/Tickler.h
index 88553732ac791..264ecefebb1d6 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;
+  Mutex mLock MOZ_UNANNOTATED;
   nsCOMPtr<nsIThread> mThread;
   nsCOMPtr<nsITimer> mTimer;
   nsCOMPtr<nsIPrefBranch> mPrefs;
diff --git a/netwerk/base/nsAsyncStreamCopier.h b/netwerk/base/nsAsyncStreamCopier.h
index b1ec9b7984075..196e905b40fa8 100644
--- a/netwerk/base/nsAsyncStreamCopier.h
+++ b/netwerk/base/nsAsyncStreamCopier.h
@@ -59,7 +59,7 @@ class nsAsyncStreamCopier final : public nsIAsyncStreamCopier,
 
   nsCOMPtr<nsISupports> mCopierCtx;
 
-  mozilla::Mutex mLock{"nsAsyncStreamCopier.mLock"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"nsAsyncStreamCopier.mLock"};
 
   nsAsyncCopyMode mMode{NS_ASYNCCOPY_VIA_READSEGMENTS};
   uint32_t mChunkSize;
diff --git a/netwerk/base/nsBufferedStreams.h b/netwerk/base/nsBufferedStreams.h
index 95bff7b0b4840..241ca8593a672 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{"nsBufferedInputStream::mMutex"};
+  mozilla::Mutex mMutex MOZ_UNANNOTATED{"nsBufferedInputStream::mMutex"};
 
   // This value is protected by mutex.
   nsCOMPtr<nsIInputStreamCallback> mAsyncWaitCallback;
diff --git a/netwerk/base/nsIOService.h b/netwerk/base/nsIOService.h
index 853218cc30b0c..ee86f79611605 100644
--- a/netwerk/base/nsIOService.h
+++ b/netwerk/base/nsIOService.h
@@ -232,7 +232,7 @@ class nsIOService final : public nsIIOService,
   nsCategoryCache<nsIChannelEventSink> mChannelEventSinks{
       NS_CHANNEL_EVENT_SINK_CATEGORY};
 
-  Mutex mMutex{"nsIOService::mMutex"};
+  Mutex mMutex MOZ_UNANNOTATED{"nsIOService::mMutex"};
   nsTArray<int32_t> mRestrictedPortList;
 
   uint32_t mTotalRequests{0};
diff --git a/netwerk/base/nsInputStreamPump.h b/netwerk/base/nsInputStreamPump.h
index c0f6eed9fb7dc..e5571ecdbc3d7 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{"nsInputStreamPump"};
+  mozilla::RecursiveMutex mMutex MOZ_UNANNOTATED{"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 39d084e1f38dd..b372800e31860 100644
--- a/netwerk/base/nsMIMEInputStream.cpp
+++ b/netwerk/base/nsMIMEInputStream.cpp
@@ -86,7 +86,7 @@ class nsMIMEInputStream : public nsIMIMEInputStream,
   nsCOMPtr<nsIInputStream> mStream;
   bool mStartedReading{false};
 
-  mozilla::Mutex mMutex{"nsMIMEInputStream::mMutex"};
+  mozilla::Mutex mMutex MOZ_UNANNOTATED{"nsMIMEInputStream::mMutex"};
 
   // This is protected by mutex.
   nsCOMPtr<nsIInputStreamCallback> mAsyncWaitCallback;
diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp
index 56c00d681bce3..c08d33be1f369 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   nsCOMPtr<nsIInputStream> mInputStream;
   nsCOMPtr<nsIAsyncInputStream> mAsyncInputStream;
diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp
index 2e05157617ce0..d81ec1fb797a9 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   CondVar mCondVar;
 
   nsresult mStatus{NS_OK};
diff --git a/netwerk/base/nsServerSocket.h b/netwerk/base/nsServerSocket.h
index f22b94e880d07..fc8390654d785 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{"nsServerSocket.mLock"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"nsServerSocket.mLock"};
   PRNetAddr mAddr = {.raw = {0, {0}}};
   nsCOMPtr<nsIEventTarget> mListenerTarget;
   bool mAttached{false};
diff --git a/netwerk/base/nsSocketTransport2.h b/netwerk/base/nsSocketTransport2.h
index 15857d67c78b2..223d1fd8a1c24 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{"nsSocketTransport.mLock"};
+  Mutex mLock MOZ_UNANNOTATED{"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 031810fbb6c63..451632ac25e72 100644
--- a/netwerk/base/nsSocketTransportService2.h
+++ b/netwerk/base/nsSocketTransportService2.h
@@ -160,7 +160,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
   Atomic<bool> mInitialized{false};
   // indicates whether we are currently in the process of shutting down
   Atomic<bool> mShuttingDown{false};
-  Mutex mLock{"nsSocketTransportService::mLock"};
+  Mutex mLock MOZ_UNANNOTATED{"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 fc70218b048ef..36fc56ce65d91 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;
+static StaticMutex gAllURLsMutex MOZ_UNANNOTATED;
 static LinkedList<nsStandardURL> gAllURLs;
 #endif
 
diff --git a/netwerk/base/nsStreamTransportService.cpp b/netwerk/base/nsStreamTransportService.cpp
index 7f9fed292124e..79dbb5ba81956 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{"nsInputStreamTransport::mMutex"};
+  Mutex mMutex MOZ_UNANNOTATED{"nsInputStreamTransport::mMutex"};
 
   // This value is protected by mutex.
   nsCOMPtr<nsIInputStreamCallback> mAsyncWaitCallback;
diff --git a/netwerk/base/nsStreamTransportService.h b/netwerk/base/nsStreamTransportService.h
index e036151396295..d89680803fec1 100644
--- a/netwerk/base/nsStreamTransportService.h
+++ b/netwerk/base/nsStreamTransportService.h
@@ -49,7 +49,8 @@ class nsStreamTransportService final : public nsIStreamTransportService,
 
   DataMutex<nsTArray<RefPtr<DelayedRunnable>>> mScheduledDelayedRunnables;
 
-  mozilla::Mutex mShutdownLock{"nsStreamTransportService.mShutdownLock"};
+  mozilla::Mutex mShutdownLock MOZ_UNANNOTATED{
+      "nsStreamTransportService.mShutdownLock"};
   bool mIsShutdown{false};
 };
 
diff --git a/netwerk/base/nsTransportUtils.cpp b/netwerk/base/nsTransportUtils.cpp
index 4b965a4fdbf4e..366aa8cb06f60 100644
--- a/netwerk/base/nsTransportUtils.cpp
+++ b/netwerk/base/nsTransportUtils.cpp
@@ -39,7 +39,7 @@ class nsTransportEventSinkProxy : public nsITransportEventSink {
  public:
   nsITransportEventSink* mSink;
   nsCOMPtr<nsIEventTarget> mTarget;
-  Mutex mLock;
+  Mutex mLock MOZ_UNANNOTATED;
   nsTransportStatusEvent* mLastEvent;
 };
 
diff --git a/netwerk/base/nsUDPSocket.h b/netwerk/base/nsUDPSocket.h
index d0114b7197c51..7736d5f995b8b 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{"nsUDPSocket.mLock"};
+  Mutex mLock MOZ_UNANNOTATED{"nsUDPSocket.mLock"};
   PRFileDesc* mFD{nullptr};
   NetAddr mAddr;
   OriginAttributes mOriginAttributes;
diff --git a/netwerk/cache/nsCacheUtils.h b/netwerk/cache/nsCacheUtils.h
index 71f3056f89dc7..e9ecb3d6c7786 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;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
   bool mShuttingDown;
   nsCOMPtr<nsIThread> mThread;
 };
diff --git a/netwerk/cache2/CacheEntry.h b/netwerk/cache2/CacheEntry.h
index e549564dac71e..e859f3f3e8f06 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{"CacheEntry"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"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 516ce694f84de..06ca89e67157a 100644
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -564,7 +564,7 @@ class ShutdownEvent : public Runnable {
   }
 
  protected:
-  mozilla::Monitor mMonitor;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
   bool mNotified{false};
 };
 
@@ -4197,7 +4197,7 @@ class SizeOfHandlesRunnable : public Runnable {
   }
 
  private:
-  mozilla::Monitor mMonitor;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
   bool mMonitorNotified;
   mozilla::MallocSizeOf mMallocSizeOf;
   CacheFileHandles const& mHandles;
diff --git a/netwerk/cache2/CacheFileUtils.h b/netwerk/cache2/CacheFileUtils.h
index 0fc5dd7d2d4ea..5e4a97d9cba7e 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;
+  static StaticMutex sLock MOZ_UNANNOTATED;
 
   // Counter of samples that is compared against kTotalSamplesReportLimit.
   static uint32_t sRecordCnt;
@@ -203,7 +203,7 @@ class CachePerfStats {
     MMA mShortAvg;
   };
 
-  static StaticMutex sLock;
+  static StaticMutex sLock MOZ_UNANNOTATED;
 
   static PerfData sData[LAST];
   static uint32_t sCacheSlowCnt;
@@ -228,7 +228,7 @@ class CacheFileLock final {
  private:
   ~CacheFileLock() = default;
 
-  mozilla::Mutex mLock{"CacheFile.mLock"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"CacheFile.mLock"};
 };
 
 }  // namespace CacheFileUtils
diff --git a/netwerk/cache2/CacheIOThread.h b/netwerk/cache2/CacheIOThread.h
index 15bca35016b2c..3790baf4aed47 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{"CacheIOThread"};
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED{"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 7adb314607498..684db9f96c159 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<CacheIndex> gInstance;
-  static StaticMutex sLock;
+  static StaticMutex sLock MOZ_UNANNOTATED;
 
   nsCOMPtr<nsIFile> mCacheDirectory;
 
diff --git a/netwerk/cache2/CacheStorageService.h b/netwerk/cache2/CacheStorageService.h
index 9e09eabe81a5e..3781d512e59f0 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{"CacheStorageService.mLock"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"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;
+    Monitor mMon MOZ_UNANNOTATED;
     bool mSignaled{false};
   };
 
diff --git a/netwerk/cookie/CookiePersistentStorage.h b/netwerk/cookie/CookiePersistentStorage.h
index 40c969f2a70fb..063b5bd867398 100644
--- a/netwerk/cookie/CookiePersistentStorage.h
+++ b/netwerk/cookie/CookiePersistentStorage.h
@@ -128,7 +128,7 @@ class CookiePersistentStorage final : public CookieStorage {
   TimeStamp mEndInitDBConn;
   nsTArray<CookieDomainTuple> mReadArray;
 
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   Atomic<bool> mInitialized;
   Atomic<bool> mInitializedDBConn;
diff --git a/netwerk/dns/ChildDNSService.h b/netwerk/dns/ChildDNSService.h
index 395058bc3b8ee..b9e672d4a0968 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<nsCStringHashKey, nsTArray<RefPtr<DNSRequestSender>>>
       mPendingRequests;
-  Mutex mPendingRequestsLock{"DNSPendingRequestsLock"};
+  Mutex mPendingRequestsLock MOZ_UNANNOTATED{"DNSPendingRequestsLock"};
   RefPtr<TRRServiceParent> mTRRServiceParent;
 };
 
diff --git a/netwerk/dns/GetAddrInfo.h b/netwerk/dns/GetAddrInfo.h
index e2c01e0fd2405..13bc2412d28c3 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{"NativeDNSResolverOverride"};
+  mozilla::RWLock mLock MOZ_UNANNOTATED{"NativeDNSResolverOverride"};
 
   nsTHashMap<nsCStringHashKey, nsTArray<NetAddr>> mOverrides;
   nsTHashMap<nsCStringHashKey, nsCString> mCnames;
diff --git a/netwerk/dns/ODoHService.h b/netwerk/dns/ODoHService.h
index 3e80fbc2e7fd7..75f06789a87a7 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;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
   Atomic<bool, Relaxed> mQueryODoHConfigInProgress;
   nsCString mODoHProxyURI;
   nsCString mODoHTargetHost;
diff --git a/netwerk/dns/TRRQuery.h b/netwerk/dns/TRRQuery.h
index 8975a26398602..e53a0459a3733 100644
--- a/netwerk/dns/TRRQuery.h
+++ b/netwerk/dns/TRRQuery.h
@@ -83,7 +83,8 @@ class TRRQuery : public AHostResolver {
   RefPtr<nsHostResolver> mHostResolver;
   RefPtr<nsHostRecord> mRecord;
 
-  Mutex mTrrLock;  // lock when accessing the mTrrA[AAA] pointers
+  Mutex mTrrLock
+      MOZ_UNANNOTATED;  // lock when accessing the mTrrA[AAA] pointers
   RefPtr<mozilla::net::TRR> mTrrA;
   RefPtr<mozilla::net::TRR> mTrrAAAA;
   RefPtr<mozilla::net::TRR> mTrrByType;
diff --git a/netwerk/dns/TRRService.h b/netwerk/dns/TRRService.h
index 47fd64956a1a1..4fb54bdc4ec87 100644
--- a/netwerk/dns/TRRService.h
+++ b/netwerk/dns/TRRService.h
@@ -119,7 +119,7 @@ class TRRService : public TRRServiceBase,
   void AddEtcHosts(const nsTArray<nsCString>&);
 
   bool mInitialized{false};
-  Mutex mLock{"TRRService"};
+  Mutex mLock MOZ_UNANNOTATED{"TRRService"};
 
   nsCString mPrivateCred;  // main thread only
   nsCString mConfirmationNS{"example.com"_ns};
diff --git a/netwerk/dns/nsDNSService2.h b/netwerk/dns/nsDNSService2.h
index 09a357203c8f7..791feed0ccd15 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{"nsDNSServer.mLock"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"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 9a9ad22977f92..53772b956cadc 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;
+  mozilla::RWLock mGraphLock MOZ_UNANNOTATED;
 
   // 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 c3a44c0415c9f..aa8df94df3254 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{"AddrHostRecord.addr_info_lock"};
+  Mutex addr_info_lock MOZ_UNANNOTATED{"AddrHostRecord.addr_info_lock"};
   // generation count of |addr_info|
   int addr_info_gencnt = 0;
   RefPtr<mozilla::net::AddrInfo> 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{"TypeHostRecord.mResultsLock"};
+  mozilla::Mutex mResultsLock MOZ_UNANNOTATED{"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 eeb604255caa4..63b74e67eee5a 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{"nsHostResolver.mLock"};
+  mutable Mutex mLock MOZ_UNANNOTATED{"nsHostResolver.mLock"};
   CondVar mIdleTaskCV;
   nsRefPtrHashtable<nsGenericHashKey<nsHostKey>, nsHostRecord> mRecordDB;
   PRTime mCreationTime;
diff --git a/netwerk/dns/nsIDNService.h b/netwerk/dns/nsIDNService.h
index bb23e7f0a24bb..7816cb6b47c86 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{"IDNService"};
+  mozilla::Mutex mLock MOZ_UNANNOTATED{"IDNService"};
 
   // guarded by mLock
   nsTArray<mozilla::net::BlocklistRange> mIDNBlocklist;
diff --git a/netwerk/ipc/ChannelEventQueue.h b/netwerk/ipc/ChannelEventQueue.h
index 1f26adaa90bea..e9db71ea7f878 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // To guarantee event execution order among threads
-  RecursiveMutex mRunningMutex;
+  RecursiveMutex mRunningMutex MOZ_UNANNOTATED;
 
   friend class AutoEventEnqueuer;
 };
diff --git a/netwerk/ipc/SocketProcessChild.h b/netwerk/ipc/SocketProcessChild.h
index f8e1b82aeb1ab..baa4566c46ee6 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{"SocketProcessChild::mMutex"};
+  Mutex mMutex MOZ_UNANNOTATED{"SocketProcessChild::mMutex"};
   nsTHashMap<uint64_t, RefPtr<BackgroundDataBridgeParent>>
       mBackgroundDataBridgeMap;
 };
diff --git a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
index ac4b18ea191a3..66cc8ea8cf604 100644
--- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
+++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
@@ -205,7 +205,8 @@ class nsGIOInputStream final : public nsIInputStream {
   bool mDirOpen{false};
   MountOperationResult mMountRes =
       MountOperationResult::MOUNT_OPERATION_SUCCESS;
-  mozilla::Monitor mMonitorMountInProgress{"GIOInputStream::MountFinished"};
+  mozilla::Monitor mMonitorMountInProgress MOZ_UNANNOTATED{
+      "GIOInputStream::MountFinished"};
   gint mMountErrorCode{};
 };
 
diff --git a/netwerk/protocol/http/HttpBackgroundChannelParent.h b/netwerk/protocol/http/HttpBackgroundChannelParent.h
index 66b708cac1343..0d886db699d4d 100644
--- a/netwerk/protocol/http/HttpBackgroundChannelParent.h
+++ b/netwerk/protocol/http/HttpBackgroundChannelParent.h
@@ -108,7 +108,7 @@ class HttpBackgroundChannelParent final : public PHttpBackgroundChannelParent {
   Atomic<bool> mIPCOpened;
 
   // Used to ensure atomicity of mBackgroundThread
-  Mutex mBgThreadMutex;
+  Mutex mBgThreadMutex MOZ_UNANNOTATED;
 
   nsCOMPtr<nsISerialEventTarget> mBackgroundThread;
 
diff --git a/netwerk/protocol/http/HttpChannelChild.h b/netwerk/protocol/http/HttpChannelChild.h
index 0b21e7bc98ac9..96c8077e21f27 100644
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -274,7 +274,7 @@ class HttpChannelChild final : public PHttpChannelChild,
   nsCOMPtr<nsIInputStream> mAltDataInputStream;
 
   // Used to ensure atomicity of mBgChild and mBgInitFailCallback
-  Mutex mBgChildMutex{"HttpChannelChild::BgChildMutex"};
+  Mutex mBgChildMutex MOZ_UNANNOTATED{"HttpChannelChild::BgChildMutex"};
 
   // Associated HTTP background channel
   RefPtr<HttpBackgroundChannelChild> mBgChild;
@@ -289,7 +289,7 @@ class HttpChannelChild final : public PHttpChannelChild,
   // Target thread for delivering ODA.
   nsCOMPtr<nsIEventTarget> mODATarget;
   // Used to ensure atomicity of mNeckoTarget / mODATarget;
-  Mutex mEventTargetMutex{"HttpChannelChild::EventTargetMutex"};
+  Mutex mEventTargetMutex MOZ_UNANNOTATED{"HttpChannelChild::EventTargetMutex"};
 
   TimeStamp mLastStatusReported;
 
diff --git a/netwerk/protocol/http/HttpConnectionBase.h b/netwerk/protocol/http/HttpConnectionBase.h
index ffb895e99c923..c28f01fb330d3 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{"nsHttpConnection::mCallbacksLock"};
+  Mutex mCallbacksLock MOZ_UNANNOTATED{"nsHttpConnection::mCallbacksLock"};
   nsMainThreadPtrHandle<nsIInterfaceRequestor> mCallbacks;
 
   nsTArray<HttpTrafficCategory> mTrafficCategory;
diff --git a/netwerk/protocol/http/HttpConnectionMgrParent.h b/netwerk/protocol/http/HttpConnectionMgrParent.h
index 716a7d7bd2174..c9a3653a2ab97 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;
+  static StaticMutex sLock MOZ_UNANNOTATED;
   static nsTHashMap<uint32_t, nsCOMPtr<nsIHttpUpgradeListener>>
       sHttpUpgradeListenerMap;
 };
diff --git a/netwerk/protocol/http/HttpTransactionParent.h b/netwerk/protocol/http/HttpTransactionParent.h
index d29b25b8e9db0..77cd2ec70a1f7 100644
--- a/netwerk/protocol/http/HttpTransactionParent.h
+++ b/netwerk/protocol/http/HttpTransactionParent.h
@@ -119,7 +119,8 @@ class HttpTransactionParent final : public PHttpTransactionParent,
   nsCOMPtr<nsIStreamListener> mChannel;
   nsCOMPtr<nsIEventTarget> mTargetThread;
   nsCOMPtr<nsIEventTarget> mODATarget;
-  Mutex mEventTargetMutex{"HttpTransactionParent::EventTargetMutex"};
+  Mutex mEventTargetMutex MOZ_UNANNOTATED{
+      "HttpTransactionParent::EventTargetMutex"};
   nsCOMPtr<nsISupports> mSecurityInfo;
   UniquePtr<nsHttpResponseHead> mResponseHead;
   UniquePtr<nsHttpHeaderArray> mResponseTrailers;
diff --git a/netwerk/protocol/http/nsCORSListenerProxy.h b/netwerk/protocol/http/nsCORSListenerProxy.h
index a4d70e3c249a5..6d158252e2e61 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;
+  mutable mozilla::Mutex mMutex MOZ_UNANNOTATED;
 };
 
 #endif
diff --git a/netwerk/protocol/http/nsHttpActivityDistributor.h b/netwerk/protocol/http/nsHttpActivityDistributor.h
index 5d9524680aa5f..b2d9ee20a45b4 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{"nsHttpActivityDistributor.mLock"};
+  Mutex mLock MOZ_UNANNOTATED{"nsHttpActivityDistributor.mLock"};
   Atomic<bool, Relaxed> mActivated{false};
   Atomic<bool, Relaxed> mObserveProxyResponse{false};
   Atomic<bool, Relaxed> mObserveConnection{false};
diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h
index 7871be7858fdc..c4d7850fd7415 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{"nsHttpChannel.mRCWNLock"};
+  mozilla::Mutex mRCWNLock MOZ_UNANNOTATED{"nsHttpChannel.mRCWNLock"};
 
   TimeStamp mNavigationStartTimeStamp;
 
diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.h b/netwerk/protocol/http/nsHttpConnectionMgr.h
index 7d2a5bde7a260..5bdc4f065eb21 100644
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
@@ -207,7 +207,8 @@ class nsHttpConnectionMgr final : public HttpConnectionMgrShell,
   // NOTE: these members may be accessed from any thread (use mReentrantMonitor)
   //-------------------------------------------------------------------------
 
-  ReentrantMonitor mReentrantMonitor{"nsHttpConnectionMgr.mReentrantMonitor"};
+  ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED{
+      "nsHttpConnectionMgr.mReentrantMonitor"};
   // This is used as a flag that we're shut down, and no new events should be
   // dispatched.
   nsCOMPtr<nsIEventTarget> mSocketThreadTarget;
diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h
index 4e1e1145c4438..becbae946877e 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{"nsHttpHandler::HttpExclusion"};
+  Mutex mHttpExclusionLock MOZ_UNANNOTATED{"nsHttpHandler::HttpExclusion"};
 
  public:
   [[nodiscard]] nsresult NewChannelId(uint64_t& channelId);
diff --git a/netwerk/protocol/http/nsHttpRequestHead.h b/netwerk/protocol/http/nsHttpRequestHead.h
index 4984edd2197e6..3d8dc2f88b97f 100644
--- a/netwerk/protocol/http/nsHttpRequestHead.h
+++ b/netwerk/protocol/http/nsHttpRequestHead.h
@@ -134,7 +134,8 @@ class nsHttpRequestHead {
 
   // We are using RecursiveMutex instead of a Mutex because VisitHeader
   // function calls nsIHttpHeaderVisitor::VisitHeader while under lock.
-  mutable RecursiveMutex mRecursiveMutex{"nsHttpRequestHead.mRecursiveMutex"};
+  mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED{
+      "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 7970dd3a6e6fd..8dab39ecdacca 100644
--- a/netwerk/protocol/http/nsHttpResponseHead.h
+++ b/netwerk/protocol/http/nsHttpResponseHead.h
@@ -207,7 +207,8 @@ class nsHttpResponseHead {
 
   // We are using RecursiveMutex instead of a Mutex because VisitHeader
   // function calls nsIHttpHeaderVisitor::VisitHeader while under lock.
-  mutable RecursiveMutex mRecursiveMutex{"nsHttpResponseHead.mRecursiveMutex"};
+  mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED{
+      "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 5c5fae13ce0ba..6b95e9075f540 100644
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -300,7 +300,7 @@ class nsHttpTransaction final : public nsAHttpTransaction,
     nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
   };
 
-  Mutex mLock{"transaction lock"};
+  Mutex mLock MOZ_UNANNOTATED{"transaction lock"};
 
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
   nsCOMPtr<nsITransportEventSink> mTransportSink;
diff --git a/netwerk/protocol/res/SubstitutingProtocolHandler.h b/netwerk/protocol/res/SubstitutingProtocolHandler.h
index 3dab910de598e..9b98954a641c6 100644
--- a/netwerk/protocol/res/SubstitutingProtocolHandler.h
+++ b/netwerk/protocol/res/SubstitutingProtocolHandler.h
@@ -103,7 +103,7 @@ class SubstitutingProtocolHandler {
   nsCString mScheme;
   Maybe<uint32_t> mFlags;
 
-  RWLock mSubstitutionsLock;
+  RWLock mSubstitutionsLock MOZ_UNANNOTATED;
   nsTHashMap<nsCStringHashKey, SubstitutionEntry> mSubstitutions;
   nsCOMPtr<nsIIOService> mIOService;
 
diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp
index 3dd0a3ed9f4b9..6858219fb7d70 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;
+  static StaticMutex sLock MOZ_UNANNOTATED;
 };
 
 nsWSAdmissionManager* nsWSAdmissionManager::sManager;
diff --git a/netwerk/protocol/websocket/WebSocketChannel.h b/netwerk/protocol/websocket/WebSocketChannel.h
index 6604102a2ba08..a9fb6a0f6aed6 100644
--- a/netwerk/protocol/websocket/WebSocketChannel.h
+++ b/netwerk/protocol/websocket/WebSocketChannel.h
@@ -357,7 +357,7 @@ class WebSocketChannel : public BaseWebSocketChannel,
   nsCOMPtr<nsIDashboardEventNotifier>
       mConnectionLogService;  // effectively const
 
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 };
 
 class WebSocketSSLChannel : public WebSocketChannel {
diff --git a/netwerk/protocol/websocket/WebSocketChannelChild.h b/netwerk/protocol/websocket/WebSocketChannelChild.h
index 25911a45b5549..0c537c09fb0f7 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   friend class StartEvent;
   friend class StopEvent;
diff --git a/netwerk/protocol/websocket/WebSocketConnectionParent.h b/netwerk/protocol/websocket/WebSocketConnectionParent.h
index 1b6dc231f1d63..f850abf04a5f7 100644
--- a/netwerk/protocol/websocket/WebSocketConnectionParent.h
+++ b/netwerk/protocol/websocket/WebSocketConnectionParent.h
@@ -59,7 +59,7 @@ class WebSocketConnectionParent final : public PWebSocketConnectionParent,
   nsCOMPtr<nsIEventTarget> mBackgroundThread;
   nsCOMPtr<nsISupports> mSecurityInfo;
   Atomic<bool> mClosed{false};
-  Mutex mMutex{"WebSocketConnectionParent::mMutex"};
+  Mutex mMutex MOZ_UNANNOTATED{"WebSocketConnectionParent::mMutex"};
 };
 
 }  // namespace net
diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp
index 5747f9bc494c7..a628c2ba6ef85 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<uintptr_t, RefPtr<DataChannelConnection>> mConnections;
   UniquePtr<media::ShutdownBlockingTicket> mShutdownBlocker;
-  static StaticMutex sInstanceMutex;
+  static StaticMutex sInstanceMutex MOZ_UNANNOTATED;
 };
 
 StaticMutex DataChannelRegistry::sInstanceMutex;
diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h
index 438d89d43d66e..76c865eeb2c11 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;
+  Mutex mLock MOZ_UNANNOTATED;
 
   void ReadBlob(already_AddRefed<DataChannelConnection> aThis, uint16_t aStream,
                 nsIInputStream* aBlob);
@@ -349,7 +349,7 @@ class DataChannelConnection final : public net::NeckoTargetHolder
       bool LessThan(const RefPtr<DataChannel>& a1,
                     const RefPtr<DataChannel>& a2) const;
     };
-    mutable Mutex mMutex;
+    mutable Mutex mMutex MOZ_UNANNOTATED;
     ChannelArray mChannels;
   };
 
@@ -563,7 +563,7 @@ class DataChannel {
   nsTArray<UniquePtr<BufferedOutgoingMsg>>
       mBufferedData;  // GUARDED_BY(mConnection->mLock)
   nsCOMPtr<nsISerialEventTarget> mMainThreadEventTarget;
-  mutable Mutex mStatsLock;  // protects mTrafficCounters
+  mutable Mutex mStatsLock MOZ_UNANNOTATED;  // protects mTrafficCounters
   TrafficCounters mTrafficCounters;
 };
 
diff --git a/netwerk/socket/nsNamedPipeService.h b/netwerk/socket/nsNamedPipeService.h
index 5d6e5f86fe4ee..cbe6ff9631e98 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;
+  Mutex mLock MOZ_UNANNOTATED;
   nsTArray<nsCOMPtr<nsINamedPipeDataObserver>>
       mObservers;  // protected by mLock
   nsTArray<nsCOMPtr<nsINamedPipeDataObserver>>
diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.h b/netwerk/streamconv/converters/nsHTTPCompressConv.h
index 9c3742733a166..c21cb3ebde52e 100644
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.h
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h
@@ -101,7 +101,7 @@ class nsHTTPCompressConv : public nsIStreamConverter,
 
   Atomic<uint32_t, Relaxed> mDecodedDataLength{0};
 
-  mutable mozilla::Mutex mMutex{"nsHTTPCompressConv"};
+  mutable mozilla::Mutex mMutex MOZ_UNANNOTATED{"nsHTTPCompressConv"};
 };
 
 }  // namespace net
diff --git a/netwerk/streamconv/converters/nsUnknownDecoder.h b/netwerk/streamconv/converters/nsUnknownDecoder.h
index 45dd6bae25b20..70cd72dbc5f9f 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;
+  mutable mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
  protected:
   nsresult ConvertEncodedData(nsIRequest* request, const char* data,
diff --git a/netwerk/system/mac/nsNetworkLinkService.h b/netwerk/system/mac/nsNetworkLinkService.h
index c236cfdd56515..aa74d4b4b8c73 100644
--- a/netwerk/system/mac/nsNetworkLinkService.h
+++ b/netwerk/system/mac/nsNetworkLinkService.h
@@ -69,7 +69,7 @@ class nsNetworkLinkService : public nsINetworkLinkService,
   bool RoutingFromKernel(nsTArray<nsCString>& aHash);
   bool RoutingTable(nsTArray<nsCString>& aHash);
 
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   nsCString mNetworkId;
   nsTArray<nsCString> mDNSSuffixList;
 
diff --git a/netwerk/system/netlink/NetlinkService.h b/netwerk/system/netlink/NetlinkService.h
index 0734e4440c633..0c3b0ca882548 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{"NetlinkService::mMutex"};
+  mozilla::Mutex mMutex MOZ_UNANNOTATED{"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 3406dd3b94ac3..30244685f2828 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   nsCString mNetworkId;
   nsTArray<nsCString> mDnsSuffixList;
   nsTArray<mozilla::net::NetAddr> mDNSResolvers;
diff --git a/netwerk/test/gtest/TestNamedPipeService.cpp b/netwerk/test/gtest/TestNamedPipeService.cpp
index c26424e46c427..8daa9247e6531 100644
--- a/netwerk/test/gtest/TestNamedPipeService.cpp
+++ b/netwerk/test/gtest/TestNamedPipeService.cpp
@@ -43,7 +43,7 @@ class Event {
   }
 
  private:
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   bool mSignaled = false;
 };
 
diff --git a/netwerk/wifi/nsWifiMonitor.h b/netwerk/wifi/nsWifiMonitor.h
index 645600af336a8..62099190b29e6 100644
--- a/netwerk/wifi/nsWifiMonitor.h
+++ b/netwerk/wifi/nsWifiMonitor.h
@@ -65,7 +65,7 @@ class nsWifiMonitor final : nsIRunnable, nsIWifiMonitor, nsIObserver {
 
   nsTArray<nsWifiListener> mListeners;
 
-  mozilla::ReentrantMonitor mReentrantMonitor;
+  mozilla::ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
 
 #ifdef XP_WIN
   mozilla::UniquePtr<WinWifiScanner> mWinWifiScanner;
diff --git a/parser/html/nsHtml5StreamListener.h b/parser/html/nsHtml5StreamListener.h
index 9a3da0cff87aa..e5f8ccdd4ff4f 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;
+  mozilla::ReentrantMonitor mDelegateMonitor MOZ_UNANNOTATED;
   // 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 bc58ab9921ba5..872a6b3a12fca 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;
+  mozilla::Mutex mTokenizerMutex MOZ_UNANNOTATED;
 
   /**
    * The scoped atom table
@@ -645,7 +645,7 @@ class nsHtml5StreamParser final : public nsISupports {
    * The current speculation is the last element
    */
   nsTArray<mozilla::UniquePtr<nsHtml5Speculation>> mSpeculations;
-  mozilla::Mutex mSpeculationMutex;
+  mozilla::Mutex mSpeculationMutex MOZ_UNANNOTATED;
 
   /**
    * 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;
+  mozilla::Mutex mFlushTimerMutex MOZ_UNANNOTATED;
 
   /**
    * Keeps track whether mFlushTimer has been armed. Unfortunately,
diff --git a/parser/html/nsHtml5TreeOpStage.h b/parser/html/nsHtml5TreeOpStage.h
index 5e54e70c9123c..37cd3ed83b812 100644
--- a/parser/html/nsHtml5TreeOpStage.h
+++ b/parser/html/nsHtml5TreeOpStage.h
@@ -54,7 +54,7 @@ class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink {
  private:
   nsTArray<nsHtml5TreeOperation> mOpQueue;
   nsTArray<nsHtml5SpeculativeLoad> mSpeculativeLoadQueue;
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 };
 
 #endif /* nsHtml5TreeOpStage_h */
diff --git a/security/certverifier/OCSPCache.h b/security/certverifier/OCSPCache.h
index 26278c1a1df44..8566511cbd42a 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   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 b42bb1dbdbfe8..c3849ac20d3d8 100644
--- a/security/manager/ssl/DataStorage.h
+++ b/security/manager/ssl/DataStorage.h
@@ -194,7 +194,8 @@ class DataStorage : public nsIObserver {
                         nsTArray<DataStorageItem>* aItems,
                         const MutexAutoLock& aProofOfLock);
 
-  Mutex mMutex;  // This mutex protects access to the following members:
+  Mutex mMutex
+      MOZ_UNANNOTATED;  // This mutex protects access to the following members:
   DataStorageTable mPersistentDataTable;
   DataStorageTable mTemporaryDataTable;
   DataStorageTable mPrivateDataTable;
@@ -208,7 +209,8 @@ class DataStorage : public nsIObserver {
 
   mozilla::Atomic<bool> mInitCalled;  // Indicates that Init() has been called.
 
-  Monitor mReadyMonitor;  // Do not acquire this at the same time as mMutex.
+  Monitor mReadyMonitor
+      MOZ_UNANNOTATED;  // 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 3e74895fe16c2..6d3deee903a99 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;
+  mozilla::Monitor monitor MOZ_UNANNOTATED;
 };
 
 class NotifyObserverRunnable : public Runnable {
diff --git a/security/manager/ssl/SharedSSLState.h b/security/manager/ssl/SharedSSLState.h
index 0fd1e23710e95..b6597967f089e 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   bool mSocketCreated;
   bool mOCSPStaplingEnabled;
   bool mOCSPMustStapleEnabled;
diff --git a/security/manager/ssl/TransportSecurityInfo.h b/security/manager/ssl/TransportSecurityInfo.h
index efc51817b0429..43d5d707bf44f 100644
--- a/security/manager/ssl/TransportSecurityInfo.h
+++ b/security/manager/ssl/TransportSecurityInfo.h
@@ -126,7 +126,7 @@ class TransportSecurityInfo : public nsITransportSecurityInfo,
   Atomic<bool> mCanceled;
 
  protected:
-  mutable ::mozilla::Mutex mMutex;
+  mutable ::mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   uint16_t mCipherSuite;
   uint16_t mProtocolVersion;
@@ -236,7 +236,7 @@ class RememberCertErrorsTable {
   }
 
  private:
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   static RememberCertErrorsTable* sInstance;
 };
diff --git a/security/manager/ssl/nsCertOverrideService.h b/security/manager/ssl/nsCertOverrideService.h
index e181a489f9311..6f924246ee1c6 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   bool mDisableAllSecurityCheck;
   nsCOMPtr<nsIFile> mSettingsFile;
   nsTHashtable<nsCertOverrideEntry> mSettingsTable;
diff --git a/security/manager/ssl/nsNSSCallbacks.cpp b/security/manager/ssl/nsNSSCallbacks.cpp
index fc5deba29bf09..6a103f0571227 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
   bool mNotifiedDone;
   nsCOMPtr<nsIStreamLoader> mLoader;
   const nsCString mAIALocation;
diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp
index ba92682b8e211..eb589fc0b229b 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;
+static StaticMutex sCheckForSmartCardChangesMutex MOZ_UNANNOTATED;
 static TimeStamp sLastCheckedForSmartCardChanges = TimeStamp::Now();
 #endif
 
diff --git a/security/manager/ssl/nsNSSComponent.h b/security/manager/ssl/nsNSSComponent.h
index ca51ad77461d2..4f2a92d436fcb 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;
+  mozilla::Monitor mLoadableCertsLoadedMonitor MOZ_UNANNOTATED;
   bool mLoadableCertsLoaded;
   nsresult mLoadableCertsLoadedResult;
 
   // mMutex protects all members that are accessed from more than one thread.
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 af5ca0a3c3e16..4f7a253bda6e0 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;
+  mozilla::Mutex mutex MOZ_UNANNOTATED;
   nsCOMPtr<nsIObserver> mPrefObserver;
   uint32_t mTlsFlags;
 };
diff --git a/security/manager/ssl/nsProtectedAuthThread.h b/security/manager/ssl/nsProtectedAuthThread.h
index e968173fccb77..5ebac7262ee59 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   nsCOMPtr<nsIRunnable> mNotifyObserver;
 
diff --git a/security/sandbox/common/test/SandboxTestingParent.h b/security/sandbox/common/test/SandboxTestingParent.h
index 45bdbf0f766a3..1899b11119d07 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<PSandboxTestingParent>&& aEnd);
 
   UniquePtr<SandboxTestingThread> mThread;
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   bool mShutdownDone;
 };
 
diff --git a/security/sandbox/linux/reporter/SandboxReporter.cpp b/security/sandbox/linux/reporter/SandboxReporter.cpp
index 0d0534b42cf3a..6512057b74f85 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;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
   StaticMutexAutoLock lock(sMutex);
 
   if (sSingleton == nullptr) {
diff --git a/security/sandbox/linux/reporter/SandboxReporter.h b/security/sandbox/linux/reporter/SandboxReporter.h
index d2dece787033f..0969111c9c041 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   // These are protected by mMutex:
   UniquePtr<SandboxReport[]> mBuffer;
   uint64_t mCount;
diff --git a/startupcache/StartupCache.h b/startupcache/StartupCache.h
index cb34c89322514..1df2770308a13 100644
--- a/startupcache/StartupCache.h
+++ b/startupcache/StartupCache.h
@@ -217,7 +217,7 @@ class StartupCache : public nsIMemoryReporter {
   nsTArray<decltype(mTable)> mOldTables;
   nsCOMPtr<nsIFile> mFile;
   loader::AutoMemMap mCacheData;
-  Mutex mTableLock;
+  Mutex mTableLock MOZ_UNANNOTATED;
 
   nsCOMPtr<nsIObserverService> mObserverService;
   RefPtr<StartupCacheListener> mListener;
diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp
index f3dc0162d475e..27872b9588439 100644
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -265,7 +265,7 @@ class UnlockNotification {
   }
 
  private:
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   CondVar mCondVar;
   bool mSignaled;
 };
diff --git a/storage/mozStorageConnection.h b/storage/mozStorageConnection.h
index 61a777ad8d77e..edfefda5b2a1e 100644
--- a/storage/mozStorageConnection.h
+++ b/storage/mozStorageConnection.h
@@ -167,7 +167,7 @@ class Connection final : public mozIStorageConnection,
    *  - Connection.mConnectionClosed
    *  - AsyncExecuteStatements.mCancelRequested
    */
-  Mutex sharedAsyncExecutionMutex;
+  Mutex sharedAsyncExecutionMutex MOZ_UNANNOTATED;
 
   /**
    * 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 3b40b07d41db1..7b2a5e595e06c 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   struct AutoVFSRegistration {
     int Init(UniquePtr<sqlite3_vfs> aVFS);
@@ -136,7 +136,7 @@ class Service : public mozIStorageService,
   /**
    * Protects mConnections.
    */
-  Mutex mRegistrationMutex;
+  Mutex mRegistrationMutex MOZ_UNANNOTATED;
 
   /**
    * 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 d1e1dbfaf6d76..e30c4cb85df81 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;
+  mozilla::ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
   bool unwedged;
 };
 
diff --git a/storage/test/gtest/test_unlock_notify.cpp b/storage/test/gtest/test_unlock_notify.cpp
index c168b2cbef377..93cc5b09a8451 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;
+  mozilla::ReentrantMonitor monitor MOZ_UNANNOTATED;
 
  protected:
   nsCOMPtr<nsIThread> mThread;
diff --git a/toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp b/toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp
index b4ec6e9b16deb..eda32471a877a 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;
+  Monitor mLock MOZ_UNANNOTATED;
   // 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 35a7be70f9578..f6667efa42d51 100644
--- a/toolkit/components/backgroundhangmonitor/HangAnnotations.h
+++ b/toolkit/components/backgroundhangmonitor/HangAnnotations.h
@@ -52,7 +52,7 @@ class BackgroundHangAnnotators {
   BackgroundHangAnnotations GatherAnnotations();
 
  private:
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   std::set<BackgroundHangAnnotator*> mAnnotators;
 };
 
diff --git a/toolkit/components/extensions/webidl-api/ExtensionEventListener.h b/toolkit/components/extensions/webidl-api/ExtensionEventListener.h
index 8fc46a3dfcdac..2137846aadb14 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 // 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 6a7b6cd0d02f9..25f31b7c9c890 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<net::ChannelEventQueue> mQueue;
 
-  Mutex mBufferMutex;
+  Mutex mBufferMutex MOZ_UNANNOTATED;
 
   bool mReceivedStop;
   bool mSentStop;
diff --git a/toolkit/components/places/History.h b/toolkit/components/places/History.h
index 58e31b367a181..71d77e5a166ba 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;
+  Mutex mShuttingDownMutex MOZ_UNANNOTATED;
   // 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;
+  Mutex mBlockShutdownMutex MOZ_UNANNOTATED;
 
   // 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 cc7163b21a579..1b9b0c213d6e5 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<TelemetryImpl*> sTelemetry;
   AutoHashtable<SlowSQLEntryType> mPrivateSQL;
   AutoHashtable<SlowSQLEntryType> mSanitizedSQL;
-  Mutex mHashMutex;
+  Mutex mHashMutex MOZ_UNANNOTATED;
   Atomic<bool, SequentiallyConsistent> mCanRecordBase;
   Atomic<bool, SequentiallyConsistent> mCanRecordExtended;
 
diff --git a/toolkit/components/telemetry/core/TelemetryEvent.cpp b/toolkit/components/telemetry/core/TelemetryEvent.cpp
index 21418c0570bbb..fe77ab91221b4 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;
+static StaticMutex gTelemetryEventsMutex MOZ_UNANNOTATED;
 
 void TelemetryEvent::InitializeGlobalState(bool aCanRecordBase,
                                            bool aCanRecordExtended) {
diff --git a/toolkit/components/telemetry/core/TelemetryHistogram.cpp b/toolkit/components/telemetry/core/TelemetryHistogram.cpp
index ed69ddee0ecd3..d20f7cc50a888 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;
+static StaticMutex gTelemetryHistogramMutex MOZ_UNANNOTATED;
 
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////
diff --git a/toolkit/components/telemetry/core/TelemetryOrigin.cpp b/toolkit/components/telemetry/core/TelemetryOrigin.cpp
index 4eb092e9df4a6..70bab61f3a85d 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;
+static StaticMutex gTelemetryOriginMutex MOZ_UNANNOTATED;
 
 typedef nsTArray<Tuple<const char*, const char*>> OriginHashesList;
 UniquePtr<OriginHashesList> gOriginHashesList;
diff --git a/toolkit/components/telemetry/core/TelemetryScalar.cpp b/toolkit/components/telemetry/core/TelemetryScalar.cpp
index 5d19b0496cf70..f404a26230fd6 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;
+static StaticMutex gTelemetryScalarsMutex MOZ_UNANNOTATED;
 
 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 bb9a112fd179e..603cf01b62232 100644
--- a/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp
+++ b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp
@@ -72,7 +72,7 @@ StaticAutoPtr<nsTArray<ChildEventData>> 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;
+static StaticMutex gTelemetryIPCAccumulatorMutex MOZ_UNANNOTATED;
 
 namespace {
 
diff --git a/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp b/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp
index 91bb7eaebe729..6c4b9590c0c93 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;
+static StaticMutex gMutex MOZ_UNANNOTATED;
 
 // -- 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 21021d8212dbe..4f35a13226cc7 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;
+  mutable mozilla::Mutex mLock MOZ_UNANNOTATED;
 
   const RefPtr<nsUrlClassifierPrefixSet> mFixedPrefixSet;
   mozilla::safebrowsing::PrefixStringMap mVLPrefixSet;
diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.h b/toolkit/components/url-classifier/nsUrlClassifierDBService.h
index a5b79753190a1..6b5f736f7fc7a 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;
+  mozilla::Mutex mPendingLookupLock MOZ_UNANNOTATED;
 
   class PendingLookup {
    public:
diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h
index 722b5077fbd05..2216df40309d2 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;
+  mutable mozilla::Mutex mLock MOZ_UNANNOTATED;
   // list of fully stored prefixes, that also form the
   // start of a run of deltas in mIndexDeltas.
   nsTArray<uint32_t> mIndexPrefixes;
diff --git a/toolkit/components/url-classifier/nsUrlClassifierUtils.h b/toolkit/components/url-classifier/nsUrlClassifierUtils.h
index 656d98c73326b..5ff9d97fdc642 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;
+  mozilla::Mutex mProviderDictLock MOZ_UNANNOTATED;
 };
 
 #endif  // nsUrlClassifierUtils_h_
diff --git a/toolkit/components/viaduct/ViaductRequest.h b/toolkit/components/viaduct/ViaductRequest.h
index 6455ce7101073..2d268635984f0 100644
--- a/toolkit/components/viaduct/ViaductRequest.h
+++ b/toolkit/components/viaduct/ViaductRequest.h
@@ -43,7 +43,7 @@ class ViaductRequest final : public nsIStreamListener,
   nsCOMPtr<nsITimer> mConnectTimeoutTimer;
   nsCOMPtr<nsITimer> mReadTimeoutTimer;
   appservices::httpconfig::protobuf::Response mResponse;
-  Monitor mMonitor;
+  Monitor mMonitor MOZ_UNANNOTATED;
   ~ViaductRequest();
 };
 
diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.h b/toolkit/components/windowwatcher/nsWindowWatcher.h
index 16c34f9e1529a..7f967f69e33ad 100644
--- a/toolkit/components/windowwatcher/nsWindowWatcher.h
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.h
@@ -108,7 +108,7 @@ class nsWindowWatcher : public nsIWindowWatcher,
  protected:
   nsTArray<nsWatcherWindowEnumerator*> mEnumeratorList;
   nsWatcherWindowEntry* mOldestWindow;
-  mozilla::Mutex mListLock;
+  mozilla::Mutex mListLock MOZ_UNANNOTATED;
 
   nsCOMPtr<nsIWindowCreator> mWindowCreator;
 };
diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp
index 083d665b21e1a..b50e86651f7ae 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;
+static StaticMutex processMapLock MOZ_UNANNOTATED;
 static std::map<ProcessId, PRFileDesc*> processToCrashFd;
 
 static std::terminate_handler oldTerminateHandler = nullptr;
diff --git a/toolkit/xre/dllservices/UntrustedModulesProcessor.h b/toolkit/xre/dllservices/UntrustedModulesProcessor.h
index ac69f40e97e56..1da5a25b2c615 100644
--- a/toolkit/xre/dllservices/UntrustedModulesProcessor.h
+++ b/toolkit/xre/dllservices/UntrustedModulesProcessor.h
@@ -150,8 +150,8 @@ class UntrustedModulesProcessor final : public nsIObserver {
  private:
   RefPtr<LazyIdleThread> mThread;
 
-  Mutex mUnprocessedMutex;
-  Mutex mModuleCacheMutex;
+  Mutex mUnprocessedMutex MOZ_UNANNOTATED;
+  Mutex mModuleCacheMutex MOZ_UNANNOTATED;
 
   // The members in this group are protected by mUnprocessedMutex
   UnprocessedModuleLoads mUnprocessedModuleLoads;
diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp
index f2b870a143567..e128c8dd4f271 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("nsUpdateDriver SetupMacCommandLine");
+  Monitor monitor MOZ_UNANNOTATED("nsUpdateDriver SetupMacCommandLine");
 
   nsresult rv = NS_DispatchToMainThread(NS_NewRunnableFunction(
       "UpdateDriverSetupMacCommandLine",
diff --git a/tools/performance/PerfStats.h b/tools/performance/PerfStats.h
index a8460e49cbe8c..2a48bbf61e987 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;
+  static StaticMutex sMutex MOZ_UNANNOTATED;
   static StaticAutoPtr<PerfStats> sSingleton;
   TimeStamp mRecordedStarts[static_cast<size_t>(Metric::Max)];
   double mRecordedTimes[static_cast<size_t>(Metric::Max)];
diff --git a/tools/profiler/core/memory_hooks.cpp b/tools/profiler/core/memory_hooks.cpp
index 0b5e3f8e53451..be83c6bf82ee2 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 static AllocationTracker* gAllocationTracker;
diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp
index 92bcc11006872..1fc3f0720c3c3 100644
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -3676,7 +3676,8 @@ class SamplerThread {
   // spy. This will ensure that the work doesn't take more than 50% of a CPU
   // core.
   int mDelaySpyStart = 0;
-  Monitor mSpyingStateMonitor{"SamplerThread::mSpyingStateMonitor"};
+  Monitor mSpyingStateMonitor MOZ_UNANNOTATED{
+      "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 80559c735b43f..606677de9d3d0 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<NativeSharedLibrary>* sSharedLibrariesList = nullptr;
-static mozilla::StaticMutex sSharedLibrariesMutex;
+static mozilla::StaticMutex sSharedLibrariesMutex MOZ_UNANNOTATED;
 
 static void SharedLibraryAddImage(const struct mach_header* mh,
                                   intptr_t vmaddr_slide) {
diff --git a/widget/GfxInfoBase.h b/widget/GfxInfoBase.h
index d3d1a85379468..cd960ccb618f7 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<JS::Value> aOut);
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace widget
diff --git a/widget/VsyncDispatcher.h b/widget/VsyncDispatcher.h
index f322fb24e4a3e..e04e6ced3202e 100644
--- a/widget/VsyncDispatcher.h
+++ b/widget/VsyncDispatcher.h
@@ -64,7 +64,7 @@ class CompositorVsyncDispatcher final {
   void ObserveVsync(bool aEnable);
 
   RefPtr<gfx::VsyncSource> mVsyncSource;
-  Mutex mCompositorObserverLock;
+  Mutex mCompositorObserverLock MOZ_UNANNOTATED;
   RefPtr<VsyncObserver> mCompositorVsyncObserver;
   bool mDidShutdown;
 };
diff --git a/widget/android/EventDispatcher.h b/widget/android/EventDispatcher.h
index a17822e248c47..c1fd60d60b877 100644
--- a/widget/android/EventDispatcher.h
+++ b/widget/android/EventDispatcher.h
@@ -77,7 +77,7 @@ class EventDispatcher final
 
   using ListenersMap = nsClassHashtable<nsStringHashKey, ListenersList>;
 
-  Mutex mLock{"mozilla::widget::EventDispatcher"};
+  Mutex mLock MOZ_UNANNOTATED{"mozilla::widget::EventDispatcher"};
   ListenersMap mListenersMap;
 
   using IterateEventsCallback =
diff --git a/widget/android/jni/Natives.h b/widget/android/jni/Natives.h
index c8df774fec358..5fab5c62c0987 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;  // Protects mNativeImpl
+  mutable RWLock mLock MOZ_UNANNOTATED;  // Protects mNativeImpl
   StorageType mNativeImpl;
 };
 
diff --git a/widget/android/nsAppShell.h b/widget/android/nsAppShell.h
index 4898809c53c96..9b1dc5ca149d4 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;
+    mozilla::Monitor mMonitor MOZ_UNANNOTATED;
     mozilla::LinkedList<Event> mQueue;
 
    public:
diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
index 44b1ae9fa31e8..2227e42b5520a 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;
+  mozilla::Mutex mCompositingLock MOZ_UNANNOTATED;
 
   mozilla::ViewRegion mNonDraggableRegion;
 
diff --git a/widget/cocoa/nsCocoaUtils.h b/widget/cocoa/nsCocoaUtils.h
index 9249a964a7924..b39c327172986 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;
+  static StaticMutex sMediaCaptureMutex MOZ_UNANNOTATED;
 };
 
 #endif  // nsCocoaUtils_h_
diff --git a/widget/gtk/DMABufLibWrapper.cpp b/widget/gtk/DMABufLibWrapper.cpp
index b31cefc075ec7..285893c85c9c0 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;
+mozilla::StaticMutex nsGbmLib::sDRILock MOZ_UNANNOTATED;
 
 void* nsGbmLib::sGbmLibHandle = nullptr;
 void* nsGbmLib::sXf86DrmLibHandle = nullptr;
diff --git a/widget/gtk/DMABufLibWrapper.h b/widget/gtk/DMABufLibWrapper.h
index 82a9dee9b682c..ca7e6839c8489 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;
+  static mozilla::StaticMutex sDRILock MOZ_UNANNOTATED;
   static bool sLibLoaded;
 };
 
diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h
index 23375d58b4c73..34e069726af33 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;
+  mozilla::Mutex mSurfaceLock MOZ_UNANNOTATED;
 
   mozilla::gfx::ColorRange mColorRange = mozilla::gfx::ColorRange::LIMITED;
 };
diff --git a/widget/gtk/WaylandVsyncSource.h b/widget/gtk/WaylandVsyncSource.h
index 37b6f539f8c8c..75b3371a7d4d5 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   bool mIsShutdown;
   bool mVsyncEnabled;
   bool mMonitorEnabled;
diff --git a/widget/gtk/WindowSurfaceProvider.h b/widget/gtk/WindowSurfaceProvider.h
index 13f450851a096..a0d6315591c52 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   // WindowSurface needs to be re-created as underlying window was changed.
   mozilla::Atomic<bool> mWindowSurfaceValid;
 #ifdef MOZ_WAYLAND
diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.h b/widget/gtk/WindowSurfaceWaylandMultiBuffer.h
index 3b336de43788f..3e26a1d5b1ffc 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;
+  mozilla::Mutex mSurfaceLock MOZ_UNANNOTATED;
 
   RefPtr<nsWindow> mWindow;
   LayoutDeviceIntSize mMozContainerSize;
diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp
index f0e7413067ed5..cd3f8689665f9 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<nsWaylandDisplay> gWaylandDisplays[MAX_DISPLAY_CONNECTIONS];
-static StaticMutex gWaylandDisplayArrayWriteMutex;
+static StaticMutex gWaylandDisplayArrayWriteMutex MOZ_UNANNOTATED;
 
 // Dispatch events to Compositor/Render queues
 void WaylandDispatchDisplays() {
diff --git a/widget/windows/AudioSession.cpp b/widget/windows/AudioSession.cpp
index fce78d96e99b7..8bdc6af228cc7 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   ThreadSafeAutoRefCnt mRefCnt;
   NS_DECL_OWNINGTHREAD
diff --git a/widget/windows/InProcessWinCompositorWidget.h b/widget/windows/InProcessWinCompositorWidget.h
index c4a9b6269d52a..8ef79bef71605 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;
+  mozilla::Mutex mTransparentSurfaceLock MOZ_UNANNOTATED;
   mozilla::Atomic<nsTransparencyMode, MemoryOrdering::Relaxed>
       mTransparencyMode;
 
diff --git a/widget/windows/JumpListBuilder.h b/widget/windows/JumpListBuilder.h
index 11ca1ed9b2878..70d3c1988148e 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<nsIThread> mIOThread;
-  ReentrantMonitor mMonitor;
+  ReentrantMonitor mMonitor MOZ_UNANNOTATED;
   nsString mAppUserModelId;
 
   bool IsSeparator(nsCOMPtr<nsIJumpListItem>& item);
diff --git a/widget/windows/nsAppShell.h b/widget/windows/nsAppShell.h
index 0c68d6b0a12d6..77502f5048eb6 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;
+  Mutex mLastNativeEventScheduledMutex MOZ_UNANNOTATED;
   TimeStamp mLastNativeEventScheduled;
   std::vector<MSG> mMsgsToRepost;
 };
diff --git a/widget/windows/nsPrinterWin.h b/widget/windows/nsPrinterWin.h
index 7148413c3a843..8afcf14d0e97f 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{"nsPrinterWin::Driver"};
+  mutable mozilla::Mutex mDriverMutex MOZ_UNANNOTATED{"nsPrinterWin::Driver"};
 };
 
 #endif  // nsPrinterWin_h_
diff --git a/xpcom/base/AvailableMemoryWatcherLinux.cpp b/xpcom/base/AvailableMemoryWatcherLinux.cpp
index 121188d8846bc..c8e8510c17ce7 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;
+  Mutex mMutex MOZ_UNANNOTATED;
 
   // 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 7b33047fcd5d8..5ad52163b5307 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   nsCOMPtr<nsITimer> mTimer;
   nsAutoHandle mLowMemoryHandle;
   HANDLE mWaitHandle;
diff --git a/xpcom/base/RLBoxSandboxPool.h b/xpcom/base/RLBoxSandboxPool.h
index 1d0730a813863..6b029af7adaac 100644
--- a/xpcom/base/RLBoxSandboxPool.h
+++ b/xpcom/base/RLBoxSandboxPool.h
@@ -63,7 +63,7 @@ class RLBoxSandboxPool : public nsITimerCallback, public nsINamed {
   nsTArray<UniquePtr<RLBoxSandboxDataBase>> mPool;
   const size_t mDelaySeconds;
   nsCOMPtr<nsITimer> mTimer;
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 };
 
 // The RLBoxSandboxDataBase class serves as the subclass for all sandbox data
diff --git a/xpcom/base/nsConsoleService.h b/xpcom/base/nsConsoleService.h
index 37b7d2e33638e..7399138e8495a 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;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
 };
 
 #endif /* __nsconsoleservice_h__ */
diff --git a/xpcom/base/nsDumpUtils.h b/xpcom/base/nsDumpUtils.h
index 0df3fa78d66ff..f18d46d6a38a7 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;  // protects mFifoInfo
+  mozilla::Mutex mFifoInfoLock MOZ_UNANNOTATED;  // protects mFifoInfo
   FifoInfoArray mFifoInfo;
 };
 
@@ -159,7 +159,7 @@ class SignalPipeWatcher : public FdWatcher {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
-  mozilla::Mutex mSignalInfoLock;  // protects mSignalInfo
+  mozilla::Mutex mSignalInfoLock MOZ_UNANNOTATED;  // protects mSignalInfo
   SignalInfoArray mSignalInfo;
 };
 
diff --git a/xpcom/base/nsMacUtilsImpl.h b/xpcom/base/nsMacUtilsImpl.h
index 7d9c1d6c93b3a..c2e0eb202ec3f 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<nsCString> sCachedAppPath;
   // For thread safe setting/checking of sCachedAppPath
-  static StaticMutex sCachedAppPathMutex;
+  static StaticMutex sCachedAppPathMutex MOZ_UNANNOTATED;
   // 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 fd74f453d65b0..523db55350f54 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   bool mIsRegistrationBlocked;
 
   StrongReportersTable* mStrongReporters;
diff --git a/xpcom/build/IOInterposer.cpp b/xpcom/build/IOInterposer.cpp
index cb4471cd7c7d2..bf0a103a56733 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;
+  mozilla::IOInterposer::Mutex mLock MOZ_UNANNOTATED;
   // Flags tracking which operations are being observed
   mozilla::Atomic<mozilla::IOInterposeObserver::Operation,
                   mozilla::MemoryOrdering::Relaxed>
diff --git a/xpcom/build/MainThreadIOLogger.cpp b/xpcom/build/MainThreadIOLogger.cpp
index c085484a69c99..6416a52c9e252 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;
+  mozilla::IOInterposer::Monitor mMonitor MOZ_UNANNOTATED;
   bool mShutdownRequired;
   std::vector<ObservationWithStack> mObservations;
 };
diff --git a/xpcom/components/nsCategoryManager.h b/xpcom/components/nsCategoryManager.h
index c85e5212e9166..770d11c82c75b 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<CategoryLeaf> mTable;
-  mozilla::Mutex mLock;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
 };
 
 /**
@@ -138,7 +138,7 @@ class nsCategoryManager final : public nsICategoryManager,
 
   CategoryAllocator mArena;
   nsClassHashtable<nsDepCharHashKey, CategoryNode> mTable;
-  mozilla::Mutex mLock;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
   bool mSuppressNotifications;
 };
 
diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h
index 4722e23625fff..7e6bd7198b8a0 100644
--- a/xpcom/components/nsComponentManager.h
+++ b/xpcom/components/nsComponentManager.h
@@ -105,7 +105,7 @@ class nsComponentManagerImpl final : public nsIComponentManager,
   nsTHashMap<nsIDPointerHashKey, nsFactoryEntry*> mFactories;
   nsTHashMap<nsCStringHashKey, nsFactoryEntry*> mContractIDs;
 
-  mozilla::Monitor mLock;
+  mozilla::Monitor mLock MOZ_UNANNOTATED;
 
   mozilla::Maybe<EntryWrapper> LookupByCID(const nsID& aCID);
   mozilla::Maybe<EntryWrapper> LookupByCID(const mozilla::MonitorAutoLock&,
diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp
index d3117a05cfef1..1a6c4bfabe865 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;
+  Mutex mLock MOZ_UNANNOTATED;
   PLDHashTable mTable;
   nsAtomSubTable();
   void GCLocked(GCKind aKind);
diff --git a/xpcom/io/FilePreferences.cpp b/xpcom/io/FilePreferences.cpp
index f2cf70a44fcb4..2feaa611efce5 100644
--- a/xpcom/io/FilePreferences.cpp
+++ b/xpcom/io/FilePreferences.cpp
@@ -21,7 +21,7 @@
 namespace mozilla {
 namespace FilePreferences {
 
-static StaticMutex sMutex;
+static StaticMutex sMutex MOZ_UNANNOTATED;
 
 static bool sBlockUNCPaths = false;
 typedef nsTArray<nsString> WinPaths;
diff --git a/xpcom/io/InputStreamLengthWrapper.h b/xpcom/io/InputStreamLengthWrapper.h
index a074d3cdcf6d6..89b6233e35a61 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   // This is used for AsyncWait and it's protected by mutex.
   nsCOMPtr<nsIInputStreamCallback> mAsyncWaitCallback;
diff --git a/xpcom/io/NonBlockingAsyncInputStream.h b/xpcom/io/NonBlockingAsyncInputStream.h
index b026e39331b55..1f98353975903 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;
+  Mutex mLock MOZ_UNANNOTATED;
 
   struct WaitClosureOnly {
     WaitClosureOnly(AsyncWaitRunnable* aRunnable, nsIEventTarget* aEventTarget);
diff --git a/xpcom/io/SeekableStreamWrapper.h b/xpcom/io/SeekableStreamWrapper.h
index 19620000cb0c0..986f8ef55230c 100644
--- a/xpcom/io/SeekableStreamWrapper.h
+++ b/xpcom/io/SeekableStreamWrapper.h
@@ -82,7 +82,7 @@ class SeekableStreamWrapper final : public nsIAsyncInputStream,
   nsCOMPtr<nsICloneableInputStream> mOriginal;
 
   // This mutex guards `mCurrent`.
-  Mutex mMutex{"SeekableStreamWrapper"};
+  Mutex mMutex MOZ_UNANNOTATED{"SeekableStreamWrapper"};
   nsCOMPtr<nsIInputStream> mCurrent;
 };
 
diff --git a/xpcom/io/SlicedInputStream.h b/xpcom/io/SlicedInputStream.h
index fb4ace0a2c8aa..c94b9683533ab 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<nsIInputStreamLengthCallback> mAsyncWaitLengthCallback;
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
 };
 
 }  // namespace mozilla
diff --git a/xpcom/io/nsMultiplexInputStream.cpp b/xpcom/io/nsMultiplexInputStream.cpp
index 5249cf2e44b4c..f27d52d59a7d2 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;  // Protects access to all data members.
+  Mutex mLock MOZ_UNANNOTATED;  // Protects access to all data members.
 
   nsTArray<StreamData> mStreams;
 
diff --git a/xpcom/io/nsPipe3.cpp b/xpcom/io/nsPipe3.cpp
index 9fc6c0543f430..a885b2a41375f 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<nsPipeInputStream> mOriginalInput;
 
-  ReentrantMonitor mReentrantMonitor;
+  ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED;
   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 aa0e93206991d..ffea2173155c9 100644
--- a/xpcom/io/nsStreamUtils.cpp
+++ b/xpcom/io/nsStreamUtils.cpp
@@ -463,7 +463,7 @@ class nsAStreamCopier : public nsIInputStreamCallback,
   nsCOMPtr<nsIAsyncInputStream> mAsyncSource;
   nsCOMPtr<nsIAsyncOutputStream> mAsyncSink;
   nsCOMPtr<nsIEventTarget> mTarget;
-  Mutex mLock;
+  Mutex mLock MOZ_UNANNOTATED;
   nsAsyncCopyCallbackFun mCallback;
   nsAsyncCopyProgressFun mProgressCallback;
   void* mClosure;
diff --git a/xpcom/io/nsStringStream.cpp b/xpcom/io/nsStringStream.cpp
index 2b3d20bab395b..1c25be94b69e3 100644
--- a/xpcom/io/nsStringStream.cpp
+++ b/xpcom/io/nsStringStream.cpp
@@ -144,7 +144,7 @@ class nsStringInputStream final : public nsIStringInputStream,
   RefPtr<StreamBufferSource> mSource;
   size_t mOffset = 0;
 
-  mozilla::ReentrantMonitor mMon{"nsStringInputStream"};
+  mozilla::ReentrantMonitor mMon MOZ_UNANNOTATED{"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 5ed462993890a..41152470c778f 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;
+  static StaticMutex sValsMutex MOZ_UNANNOTATED;
 };
 
 void** BenchCollections::sVals;
diff --git a/xpcom/tests/gtest/TestDeadlockDetector.cpp b/xpcom/tests/gtest/TestDeadlockDetector.cpp
index 2fa0036fd40f2..c9a4f1a3de28c 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("dd.sanity4.m1");
+  mozilla::ReentrantMonitor m1 MOZ_UNANNOTATED("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("dd.sanity4.m1");
+  mozilla::RecursiveMutex m1 MOZ_UNANNOTATED("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 53461d755d810..f2926c4b198c1 100644
--- a/xpcom/tests/gtest/TestDelayedRunnable.cpp
+++ b/xpcom/tests/gtest/TestDelayedRunnable.cpp
@@ -127,7 +127,7 @@ TEST(DelayedRunnable, TimerFiresBeforeRunnableRuns)
   auto noTailTaskQueue = MakeRefPtr<TaskQueue>(
       do_AddRef(pool), "TestDelayedRunnable noTailTaskQueue",
       /* aSupportsTailDispatch = */ false);
-  Monitor outerMonitor(__func__);
+  Monitor outerMonitor MOZ_UNANNOTATED(__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(__func__);
+        Monitor innerMonitor MOZ_UNANNOTATED(__func__);
         MonitorAutoLock lock(innerMonitor);
         auto timer = MakeRefPtr<mozilla::MediaTimer>();
         timer->WaitFor(mozilla::TimeDuration::FromMilliseconds(1), __func__)
diff --git a/xpcom/tests/gtest/TestRWLock.cpp b/xpcom/tests/gtest/TestRWLock.cpp
index b300695be7686..481400163bbbd 100644
--- a/xpcom/tests/gtest/TestRWLock.cpp
+++ b/xpcom/tests/gtest/TestRWLock.cpp
@@ -69,7 +69,7 @@ RWLockRunnable::Run() {
 TEST(RWLock, SmokeTest)
 {
   nsCOMPtr<nsIThread> threads[sNumThreads];
-  RWLock rwlock("test lock");
+  RWLock rwlock MOZ_UNANNOTATED("test lock");
   mozilla::Atomic<size_t> data(0);
 
   for (size_t i = 0; i < sNumThreads; ++i) {
@@ -103,7 +103,7 @@ static std::invoke_result_t<Function> RunOnBackgroundThread(
 
 TEST(RWLock, AutoTryReadLock)
 {
-  RWLock l1("autotryreadlock");
+  RWLock l1 MOZ_UNANNOTATED("autotryreadlock");
   {
     AutoTryReadLock autol1(l1);
 
@@ -121,7 +121,7 @@ TEST(RWLock, AutoTryReadLock)
     EXPECT_TRUE(autol2);
 
     {
-      RWLock l2("autotryreadlock2");
+      RWLock l2 MOZ_UNANNOTATED("autotryreadlock2");
       AutoTryReadLock autol3(l2);
 
       EXPECT_TRUE(autol3);
@@ -155,7 +155,7 @@ TEST(RWLock, AutoTryReadLock)
 
 TEST(RWLock, AutoTryWriteLock)
 {
-  RWLock l1("autotrywritelock");
+  RWLock l1 MOZ_UNANNOTATED("autotrywritelock");
   {
     AutoTryWriteLock autol1(l1);
 
@@ -173,7 +173,7 @@ TEST(RWLock, AutoTryWriteLock)
     EXPECT_FALSE(autol2);
 
     {
-      RWLock l2("autotrywritelock2");
+      RWLock l2 MOZ_UNANNOTATED("autotrywritelock2");
       AutoTryWriteLock autol3(l2);
 
       EXPECT_TRUE(autol3);
diff --git a/xpcom/tests/gtest/TestSynchronization.cpp b/xpcom/tests/gtest/TestSynchronization.cpp
index e994d9bc276c1..8e808586e26c5 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("autolock");
+  Mutex l1 MOZ_UNANNOTATED("autolock");
   MutexAutoLock autol1(l1);
 
   l1.AssertCurrentThreadOwns();
 
   {
-    Mutex l2("autolock2");
+    Mutex l2 MOZ_UNANNOTATED("autolock2");
     MutexAutoLock autol2(l2);
 
     l1.AssertCurrentThreadOwns();
@@ -239,7 +239,7 @@ TEST(Synchronization, AutoLock)
 //
 TEST(Synchronization, AutoTryLock)
 {
-  Mutex l1("autotrylock");
+  Mutex l1 MOZ_UNANNOTATED("autotrylock");
   MutexAutoTryLock autol1(l1);
 
   EXPECT_TRUE(autol1);
@@ -252,7 +252,7 @@ TEST(Synchronization, AutoTryLock)
   l1.AssertCurrentThreadOwns();
 
   {
-    Mutex l2("autotrylock2");
+    Mutex l2 MOZ_UNANNOTATED("autotrylock2");
     MutexAutoTryLock autol3(l2);
 
     EXPECT_TRUE(autol3);
@@ -268,8 +268,8 @@ TEST(Synchronization, AutoTryLock)
 //
 TEST(Synchronization, AutoUnlock)
 {
-  Mutex l1("autounlock");
-  Mutex l2("autounlock2");
+  Mutex l1 MOZ_UNANNOTATED("autounlock");
+  Mutex l2 MOZ_UNANNOTATED("autounlock2");
 
   l1.Lock();
   l1.AssertCurrentThreadOwns();
diff --git a/xpcom/tests/gtest/TestTaskQueue.cpp b/xpcom/tests/gtest/TestTaskQueue.cpp
index 6d45c9d561fe5..fe09567ed133a 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("TaskQueue::EventOrder::monitor");
+  Monitor monitor MOZ_UNANNOTATED("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 b80feb011647e..eefcfaca64907 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("ThreadPool::Parallelism");
+  Monitor mon MOZ_UNANNOTATED("ThreadPool::Parallelism");
   bool done = false;
   nsCOMPtr<nsIRunnable> r1 = new Runnable1(mon, done);
   nsCOMPtr<nsIRunnable> r2 = new Runnable2(mon, done);
diff --git a/xpcom/tests/gtest/TestThrottledEventQueue.cpp b/xpcom/tests/gtest/TestThrottledEventQueue.cpp
index f3b7828f07ee8..834e6c0813265 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("TEQ AwaitIdle");
+  Mutex mutex MOZ_UNANNOTATED("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("AwaitIdleMixed");
+  Mutex mutex MOZ_UNANNOTATED("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("AwaitIdlePaused");
+  Mutex mutex MOZ_UNANNOTATED("AwaitIdlePaused");
   CondVar cond(mutex, "AwaitIdlePaused");
 
   string dequeue_await;           // mutex
diff --git a/xpcom/tests/gtest/TestTimers.cpp b/xpcom/tests/gtest/TestTimers.cpp
index e45d8b0a179a6..ae4c075794ddb 100644
--- a/xpcom/tests/gtest/TestTimers.cpp
+++ b/xpcom/tests/gtest/TestTimers.cpp
@@ -173,7 +173,7 @@ class TimerHelper {
  private:
   TimeStamp mStart;
   RefPtr<nsITimer> mTimer;
-  mutable Monitor mMonitor;
+  mutable Monitor mMonitor MOZ_UNANNOTATED;
   uint32_t mBlockTime = 0;
   Maybe<uint32_t> mLastDelay;
   RefPtr<nsIEventTarget> mTarget;
diff --git a/xpcom/threads/BlockingResourceBase.h b/xpcom/threads/BlockingResourceBase.h
index abf89d53a806c..8bb7a78f6f655 100644
--- a/xpcom/threads/BlockingResourceBase.h
+++ b/xpcom/threads/BlockingResourceBase.h
@@ -9,6 +9,7 @@
 
 #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 433518f76499d..2db2456e309ec 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;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
 
   /**
    * 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 dbd05c1b17ff5..5540bd507fddc 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;
+  Mutex mMutex MOZ_UNANNOTATED;
   ResolveOrRejectValue mValue;
   bool mUseSynchronousTaskDispatch = false;
   bool mUseDirectTaskDispatch = false;
diff --git a/xpcom/threads/SpinEventLoopUntil.h b/xpcom/threads/SpinEventLoopUntil.h
index 6825be3d453bd..1e2735a36cab0 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;
+  static StaticMutex sStackMutex MOZ_UNANNOTATED;
 
   // 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 49235e764aa66..898b76f529520 100644
--- a/xpcom/threads/SyncRunnable.h
+++ b/xpcom/threads/SyncRunnable.h
@@ -124,7 +124,7 @@ class SyncRunnable : public Runnable {
 
  private:
   nsCOMPtr<nsIRunnable> mRunnable;
-  mozilla::Monitor mMonitor;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
   bool mDone;
 };
 
diff --git a/xpcom/threads/TaskController.h b/xpcom/threads/TaskController.h
index 5b7ff046be733..f9479bafd14bf 100644
--- a/xpcom/threads/TaskController.h
+++ b/xpcom/threads/TaskController.h
@@ -371,10 +371,10 @@ class TaskController {
   void RunPoolThread();
 
   static std::unique_ptr<TaskController> sSingleton;
-  static StaticMutex sSingletonMutex;
+  static StaticMutex sSingletonMutex MOZ_UNANNOTATED;
 
   // This protects access to the task graph.
-  Mutex mGraphMutex;
+  Mutex mGraphMutex MOZ_UNANNOTATED;
 
   // 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 2b318ef5180a1..389221cf36e28 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;
+  Monitor mQueueMonitor MOZ_UNANNOTATED;
 
   typedef struct TaskStruct {
     nsCOMPtr<nsIRunnable> event;
diff --git a/xpcom/threads/ThreadEventQueue.h b/xpcom/threads/ThreadEventQueue.h
index 14479cb5c5b2a..74edb8c96fcd2 100644
--- a/xpcom/threads/ThreadEventQueue.h
+++ b/xpcom/threads/ThreadEventQueue.h
@@ -74,7 +74,7 @@ class ThreadEventQueue final : public SynchronizedEventQueue {
 
   nsTArray<NestedQueueItem> mNestedQueues;
 
-  Mutex mLock;
+  Mutex mLock MOZ_UNANNOTATED;
   CondVar mEventsAvailable;
 
   bool mEventsAreDoomed = false;
diff --git a/xpcom/threads/ThrottledEventQueue.cpp b/xpcom/threads/ThrottledEventQueue.cpp
index 578d7a4cd7263..5584207d1328f 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;
+  mutable Mutex mMutex MOZ_UNANNOTATED;
   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 a7b66370e9b53..4e1d1fb121bb0 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;
+  mozilla::Monitor mMonitor MOZ_UNANNOTATED;
 
  public:
   TimerEventAllocator()
diff --git a/xpcom/threads/TimerThread.h b/xpcom/threads/TimerThread.h
index f2ee487a66684..6656ce5694699 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;
+  Monitor mMonitor MOZ_UNANNOTATED;
 
   bool mShutdown;
   bool mWaiting;
diff --git a/xpcom/threads/nsEnvironment.h b/xpcom/threads/nsEnvironment.h
index acc9200bac2e3..9187b8df82420 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;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
 };
 
 #endif /* !nsEnvironment_h__ */
diff --git a/xpcom/threads/nsProcess.h b/xpcom/threads/nsProcess.h
index 9a7105945e3b4..9d80f8ea5a81c 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;
+  mozilla::Mutex mLock MOZ_UNANNOTATED;
   bool mShutdown;
   bool mBlocking;
   bool mStartHidden;
diff --git a/xpcom/threads/nsThreadManager.cpp b/xpcom/threads/nsThreadManager.cpp
index b7f78b15a0e74..3c5c7b6c58558 100644
--- a/xpcom/threads/nsThreadManager.cpp
+++ b/xpcom/threads/nsThreadManager.cpp
@@ -66,7 +66,7 @@ class BackgroundEventTarget final : public nsIEventTarget {
   nsCOMPtr<nsIThreadPool> mPool;
   nsCOMPtr<nsIThreadPool> mIOPool;
 
-  Mutex mMutex;
+  Mutex mMutex MOZ_UNANNOTATED;
   nsTArray<RefPtr<TaskQueue>> mTaskQueues;
   bool mIsBackgroundDelayedRunnablesCanceled;
 };
diff --git a/xpcom/threads/nsThreadPool.h b/xpcom/threads/nsThreadPool.h
index 7bdafde57c660..a8b8425bcdb9e 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<nsIRunnable> aEvent, uint32_t aFlags);
 
   nsCOMArray<nsIThread> mThreads;
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   mozilla::CondVar mEventsAvailable;
   mozilla::EventQueue mEvents;
   uint32_t mThreadLimit;
diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp
index 4e6c93181b67f..c89b8108d7044 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;
+  static mozilla::StaticMutex sMutex MOZ_UNANNOTATED;
   TimerThread* mThread;
 };
 
@@ -310,7 +310,7 @@ static mozilla::LogModule* GetTimerFiringsLog() { return sTimerFiringsLog; }
 #include <math.h>
 
 /* static */
-mozilla::StaticMutex nsTimerImpl::sDeltaMutex;
+mozilla::StaticMutex nsTimerImpl::sDeltaMutex MOZ_UNANNOTATED;
 /* static */
 double nsTimerImpl::sDeltaSumSquared = 0;
 /* static */
diff --git a/xpcom/threads/nsTimerImpl.h b/xpcom/threads/nsTimerImpl.h
index a1f993cb8e0f9..ecf7202fe1867 100644
--- a/xpcom/threads/nsTimerImpl.h
+++ b/xpcom/threads/nsTimerImpl.h
@@ -173,12 +173,12 @@ class nsTimerImpl {
   mozilla::TimeStamp mTimeout;
 
   RefPtr<nsITimer> mITimer;
-  mozilla::Mutex mMutex;
+  mozilla::Mutex mMutex MOZ_UNANNOTATED;
   Callback mCallback;
   // Counter because in rare cases we can Fire reentrantly
   unsigned int mFiring;
 
-  static mozilla::StaticMutex sDeltaMutex;
+  static mozilla::StaticMutex sDeltaMutex MOZ_UNANNOTATED;
   static double sDeltaSum;
   static double sDeltaSumSquared;
   static double sDeltaNum;
diff --git a/xpfe/appshell/AppWindow.h b/xpfe/appshell/AppWindow.h
index 8a9a2492123fe..ff2befb80bd8d 100644
--- a/xpfe/appshell/AppWindow.h
+++ b/xpfe/appshell/AppWindow.h
@@ -344,7 +344,7 @@ class AppWindow final : public nsIBaseWindow,
   nsCOMPtr<nsIRemoteTab> mPrimaryBrowserParent;
 
   nsCOMPtr<nsITimer> mSPTimer;
-  mozilla::Mutex mSPTimerLock;
+  mozilla::Mutex mSPTimerLock MOZ_UNANNOTATED;
   WidgetListenerDelegate mWidgetListenerDelegate;
 
  private:
-- 
GitLab