Skip to content

Commit d2f8ad1

Browse files
committed
fix
1 parent 26c198f commit d2f8ad1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libraries/Common/src/System/Net/StreamBuffer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ public int WriteBytesAvailable
132132

133133
public void Write(ReadOnlySpan<byte> buffer)
134134
{
135-
if (!Thread.IsThreadStartSupported) throw new PlatformNotSupportedException();
136-
137135
if (buffer.Length == 0)
138136
{
139137
return;

src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ private void ExitImpl()
309309
[MethodImpl(MethodImplOptions.NoInlining)]
310310
private ThreadId TryEnterSlow(int timeoutMs, ThreadId currentThreadId)
311311
{
312-
if (!Thread.IsThreadStartSupported) throw new PlatformNotSupportedException();
313-
314312
Debug.Assert(timeoutMs >= -1);
315313

316314
if (!currentThreadId.IsInitialized)
@@ -394,6 +392,8 @@ private ThreadId TryEnterSlow(int timeoutMs, ThreadId currentThreadId)
394392
spinCount = maxSpinCount;
395393
}
396394

395+
if (!Thread.IsThreadStartSupported) throw new PlatformNotSupportedException(); // this should not happen, but it helps to trim the code below on ST platforms
396+
397397
for (short spinIndex = 0; ;)
398398
{
399399
LowLevelSpinWaiter.Wait(spinIndex, SpinSleep0Threshold, isSingleProcessor: false);
@@ -483,6 +483,8 @@ private ThreadId TryEnterSlow(int timeoutMs, ThreadId currentThreadId)
483483
goto Locked;
484484
}
485485

486+
if (!Thread.IsThreadStartSupported) throw new PlatformNotSupportedException(); // this should not happen, but it helps to trim the code below on ST platforms
487+
486488
// Lock was not acquired and a waiter was registered. All following paths need to unregister the waiter, including
487489
// exceptional paths.
488490
try

0 commit comments

Comments
 (0)