         private var isPreviewForGIFGenerated = false
         private var scale: CGFloat?
         private var thumbnail: ImageRequest.ThumbnailOptions?
+        private let lock = NSLock()
+
+        public var isAsynchronous: Bool { thumbnail != nil }
 
         public init() { }
-
-        public var isAsynchronous: Bool { thumbnail != nil }
 
         /// Returns `nil` if progressive decoding is not allowed for the given
         /// content.

    ///
    /// - note: The default decoder supports progressive JPEG. It produces a new
    /// preview every time it encounters a new full frame.
    public final class Default: ImageDecoding {
        // Number of scans that the decoder has found so far. The last scan might be
        // incomplete at this point.
        var numberOfScans: Int { scanner.numberOfScans }

   return false
}

private struct ProgressiveJPEGScanner: Sendable {
    // Number of scans that the decoder has found so far. The last scan might be
    // incomplete at this point.
    private(set) var numberOfScans = 0
