1010//===----------------------------------------------------------------------===//
1111
1212#if canImport(System)
13- import System
13+ @ preconcurrency import System
1414#else
1515@preconcurrency import SystemPackage
1616#endif
@@ -27,10 +27,6 @@ import Musl
2727import WinSDK
2828#endif
2929
30- #if canImport(Synchronization)
31- import Synchronization
32- #endif
33-
3430/// An object that repersents a subprocess that has been
3531/// executed. You can use this object to send signals to the
3632/// child process as well as stream its output and error.
@@ -48,11 +44,8 @@ public final class Execution<
4844 internal let error : Error
4945 internal let outputPipe : CreatedPipe
5046 internal let errorPipe : CreatedPipe
51- #if canImport(Synchronization)
52- internal let outputConsumptionState : AtomicBox < Atomic < OutputConsumptionState . RawValue > >
53- #else
54- internal let outputConsumptionState : AtomicBox < LockedState < OutputConsumptionState > >
55- #endif
47+ internal let outputConsumptionState : AtomicBox
48+
5649 #if os(Windows)
5750 internal let consoleBehavior : PlatformOptions . ConsoleBehavior
5851
@@ -69,11 +62,7 @@ public final class Execution<
6962 self . error = error
7063 self . outputPipe = outputPipe
7164 self . errorPipe = errorPipe
72- #if canImport(Synchronization)
73- self . outputConsumptionState = AtomicBox ( Atomic ( 0 ) )
74- #else
75- self . outputConsumptionState = AtomicBox ( LockedState ( OutputConsumptionState ( rawValue: 0 ) ) )
76- #endif
65+ self . outputConsumptionState = AtomicBox ( )
7766 self . consoleBehavior = consoleBehavior
7867 }
7968 #else
@@ -89,11 +78,7 @@ public final class Execution<
8978 self . error = error
9079 self . outputPipe = outputPipe
9180 self . errorPipe = errorPipe
92- #if canImport(Synchronization)
93- self . outputConsumptionState = AtomicBox ( Atomic ( 0 ) )
94- #else
95- self . outputConsumptionState = AtomicBox ( LockedState ( OutputConsumptionState ( rawValue: 0 ) ) )
96- #endif
81+ self . outputConsumptionState = AtomicBox ( )
9782 }
9883 #endif // os(Windows)
9984}
@@ -107,9 +92,9 @@ extension Execution where Output == SequenceOutput {
10792 /// Accessing this property will **fatalError** if this property was
10893 /// accessed multiple times. Subprocess communicates with parent process
10994 /// via pipe under the hood and each pipe can only be consumed once.
110- public var standardOutput : some AsyncSequence < SequenceOutput . Buffer , any Swift . Error > {
95+ public var standardOutput : AsyncBufferSequence {
11196 let consumptionState = self . outputConsumptionState. bitwiseXor (
112- OutputConsumptionState . standardOutputConsumed,
97+ OutputConsumptionState . standardOutputConsumed
11398 )
11499
115100 guard consumptionState. contains ( . standardOutputConsumed) ,
@@ -130,9 +115,9 @@ extension Execution where Error == SequenceOutput {
130115 /// Accessing this property will **fatalError** if this property was
131116 /// accessed multiple times. Subprocess communicates with parent process
132117 /// via pipe under the hood and each pipe can only be consumed once.
133- public var standardError : some AsyncSequence < SequenceOutput . Buffer , any Swift . Error > {
118+ public var standardError : AsyncBufferSequence {
134119 let consumptionState = self . outputConsumptionState. bitwiseXor (
135- OutputConsumptionState . standardOutputConsumed,
120+ OutputConsumptionState . standardOutputConsumed
136121 )
137122
138123 guard consumptionState. contains ( . standardErrorConsumed) ,
0 commit comments