File tree 8 files changed +9
-11
lines changed
System.Private.CoreLib/src
System.Runtime/tests/System.IO.Tests
mono/System.Private.CoreLib
8 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,11 @@ public static async Task OutWriteAndWriteLineOverloads()
158
158
Console . SetOut ( sw ) ;
159
159
TextWriter writer = Console . Out ;
160
160
Assert . NotNull ( writer ) ;
161
- // Browser bypasses SyncTextWriter for faster startup
162
- if ( ! OperatingSystem . IsBrowser ( ) )
161
+ // single-threaded WASM bypasses SyncTextWriter for faster startup
162
+ if ( PlatformDetection . IsThreadingSupported )
163
163
Assert . NotEqual ( writer , sw ) ; // the writer we provide gets wrapped
164
+ else
165
+ Assert . Equal ( writer , sw ) ; // the writer we provide does not get wrapped
164
166
165
167
// We just want to ensure none of these throw exceptions, we don't actually validate
166
168
// what was written.
Original file line number Diff line number Diff line change 12
12
13
13
public class SyncTextWriter
14
14
{
15
- // Browser bypasses SyncTextWriter for faster startup
15
+ // single-threaded WASM bypasses SyncTextWriter for faster startup
16
16
[ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
17
17
public void SyncTextWriterLockedOnThis ( )
18
18
{
Original file line number Diff line number Diff line change 22
22
<IsBigEndian Condition="'$(Platform)' == 's390x'">true</IsBigEndian>
23
23
<Is64Bit Condition="'$(Platform)' == 'arm64' or '$(Platform)' == 'x64' or '$(Platform)' == 's390x' or '$(Platform)' == 'loongarch64' or '$(Platform)' == 'ppc64le' or '$(Platform)' == 'riscv64'">true</Is64Bit>
24
24
<UseMinimalGlobalizationData Condition="'$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true'">true</UseMinimalGlobalizationData>
25
- <FeatureWasmManagedThreads Condition="'$(WasmEnableThreads)' == 'true'">true</FeatureWasmManagedThreads>
26
- <DefineConstants Condition="'$(FeatureWasmManagedThreads)' == 'true'">$(DefineConstants);FEATURE_WASM_MANAGED_THREADS</DefineConstants>
27
25
</PropertyGroup>
28
26
<PropertyGroup>
29
27
<DefineConstants Condition="'$(IsBigEndian)' == 'true'">$(DefineConstants);BIGENDIAN</DefineConstants>
Original file line number Diff line number Diff line change @@ -759,7 +759,7 @@ public static TextWriter Synchronized(TextWriter writer)
759
759
{
760
760
ArgumentNullException . ThrowIfNull ( writer ) ;
761
761
762
- #if ! TARGET_BROWSER || FEATURE_WASM_MANAGED_THREADS
762
+ #if ( ! TARGET_BROWSER && ! TARGET_WASI ) || FEATURE_WASM_MANAGED_THREADS
763
763
return writer is SyncTextWriter ? writer : new SyncTextWriter ( writer ) ;
764
764
#else
765
765
return writer ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public void ObjectClosedReadLineBaseStream()
29
29
Assert . Throws < ObjectDisposedException > ( ( ) => sr . ReadLine ( ) ) ;
30
30
}
31
31
32
- // Browser bypasses SyncTextWriter for faster startup
32
+ // single-threaded WASM bypasses SyncTextWriter for faster startup
33
33
[ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
34
34
public void Synchronized_NewObject ( )
35
35
{
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ namespace System.IO.Tests
7
7
{
8
8
public partial class WriteTests
9
9
{
10
- // Browser bypasses SyncTextWriter for faster startup
10
+ // single-threaded WASM bypasses SyncTextWriter for faster startup
11
11
[ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
12
12
public void Synchronized_NewObject ( )
13
13
{
Original file line number Diff line number Diff line change @@ -690,7 +690,7 @@ public void DisposeAsync_ExceptionReturnedInTask()
690
690
Assert . Same ( e , vt . AsTask ( ) . Exception . InnerException ) ;
691
691
}
692
692
693
- // Browser bypasses SyncTextWriter for faster startup
693
+ // single-threaded WASM bypasses SyncTextWriter for faster startup
694
694
[ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
695
695
public async Task FlushAsync_Precanceled ( )
696
696
{
Original file line number Diff line number Diff line change 13
13
<Platforms >x64;x86;arm;armv6;arm64;riscv64;s390x;wasm;ppc64le</Platforms >
14
14
15
15
<EmitCompilerGeneratedFiles >true</EmitCompilerGeneratedFiles >
16
- <FeatureWasmManagedThreads Condition =" '$(WasmEnableThreads)' == 'true'" >true</FeatureWasmManagedThreads >
17
- <DefineConstants Condition =" '$(FeatureWasmManagedThreads)' == 'true'" >$(DefineConstants);FEATURE_WASM_MANAGED_THREADS</DefineConstants >
18
16
</PropertyGroup >
19
17
20
18
<!-- Note that various places in SPCL depend on this resource name i.e. TplEventSource -->
You can’t perform that action at this time.
0 commit comments