mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 04:05:40 +00:00
Obsolesce WaitOneAsync
TaskCompletionSource is recommended for execution suspension while waiting for an asynchronous operation to complete
This commit is contained in:
parent
2ead3cbb8a
commit
e058ab75bc
@ -1,7 +1,7 @@
|
||||
namespace X10D;
|
||||
namespace X10D.Threading;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="WaitHandle" />.
|
||||
/// Threading-related extension methods for <see cref="WaitHandle" />.
|
||||
/// </summary>
|
||||
public static class WaitHandleExtensions
|
||||
{
|
||||
@ -13,6 +13,12 @@ public static class WaitHandleExtensions
|
||||
/// <see langword="true" /> if the current instance receives a signal. If the current instance is never signaled,
|
||||
/// <see cref="WaitOneAsync" /> never returns.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// It is heavily recommended that the use of this method is minimal, or non-existent. For suspension of execution when
|
||||
/// performing an asynchronous operation, use <see cref="TaskCompletionSource" /> or
|
||||
/// <see cref="TaskCompletionSource{TResult}" />.
|
||||
/// </remarks>
|
||||
[Obsolete("Consider using a TaskCompletionSource instead.")]
|
||||
public static Task<bool> WaitOneAsync(this WaitHandle handle)
|
||||
{
|
||||
if (handle is null)
|
Loading…
Reference in New Issue
Block a user