This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate CoreCLR-specific methods into partial struct
- Loading branch information
1 parent
eb234ae
commit 675a5a1
Showing
3 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/mscorlib/src/System/Threading/Tasks/ValueTask.CoreCLR.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
namespace System.Threading.Tasks | ||
{ | ||
readonly partial struct ValueTask<TResult> | ||
{ | ||
private static void ThrowNullTaskException() => ThrowHelper.ThrowArgumentNullException(ExceptionArgument.task); | ||
|
||
private bool IsTaskCompletedSuccessfully => _task.IsCompletedSuccessfully; | ||
|
||
private Task<TResult> GetTaskForResult() => AsyncTaskMethodBuilder<TResult>.GetTaskForResult(_result); | ||
} | ||
} |