diff --git a/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift b/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift index f0fc90378d5..89cb7065d5c 100644 --- a/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift +++ b/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift @@ -17,6 +17,9 @@ import DequeModule import NIOConcurrencyHelpers import _NIODataStructures +@usableFromInline +let yieldIDCounter = ManagedAtomic(0) + /// The delegate of the ``NIOAsyncWriter``. It is the consumer of the yielded writes to the ``NIOAsyncWriter``. /// Furthermore, the delegate gets informed when the ``NIOAsyncWriter`` terminated. /// @@ -435,13 +438,12 @@ extension NIOAsyncWriter { } @usableFromInline - /* private */ internal let _yieldIDCounter = ManagedAtomic(0) @inlinable func generateUniqueYieldID() -> YieldID { // Using relaxed is fine here since we do not need any strict ordering just a // unique ID for every yield. - .init(value: self._yieldIDCounter.loadThenWrappingIncrement(ordering: .relaxed)) + .init(value: yieldIDCounter.loadThenWrappingIncrement(ordering: .relaxed)) } }