Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@ -32,6 +32,7 @@ using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace System.Threading
@ -64,7 +65,7 @@ namespace System.Threading
[ComVisible (true)]
public sealed class Timer
: MarshalByRefObject, IDisposable
: MarshalByRefObject, IDisposable, IAsyncDisposable
{
static Scheduler scheduler => Scheduler.Instance;
#region Timer instance fields
@ -200,6 +201,12 @@ namespace System.Threading
return true;
}
public ValueTask DisposeAsync ()
{
Dispose ();
return new ValueTask (Task.FromResult<object> (null));
}
// extracted from ../../../../external/referencesource/mscorlib/system/threading/timer.cs
internal void KeepRootedWhileScheduled()
{