# HG changeset patch # User cin # Date 1491863718 -10800 # Node ID 9ee78a345738900193b23d8f2d5e1eca99334312 # Parent a01d9df88d74c741fdf3def358092664e54e23e9 Minor code changes diff -r a01d9df88d74 -r 9ee78a345738 Implab/Components/Disposable.cs --- a/Implab/Components/Disposable.cs Tue Apr 04 12:04:05 2017 +0300 +++ b/Implab/Components/Disposable.cs Tue Apr 11 01:35:18 2017 +0300 @@ -8,7 +8,7 @@ /// Base class the objects which support disposing. /// public class Disposable : IDisposable { - + int m_disposed; public event EventHandler Disposed; @@ -75,11 +75,9 @@ /// из нескольких потоков. /// protected virtual void Dispose(bool disposing) { - if (disposing) { - EventHandler temp = Disposed; - if (temp != null) - temp(this, EventArgs.Empty); - } + if (disposing) + Disposed.DispatchEvent(this, EventArgs.Empty); + } [SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification = "Dipose(bool) and GC.SuppessFinalize are called")] diff -r a01d9df88d74 -r 9ee78a345738 Implab/Safe.cs --- a/Implab/Safe.cs Tue Apr 04 12:04:05 2017 +0300 +++ b/Implab/Safe.cs Tue Apr 11 01:35:18 2017 +0300 @@ -6,6 +6,10 @@ using System.Diagnostics; using System.Collections; +#if NET_4_5 +using System.Threading.Tasks; +#endif + namespace Implab { public static class Safe @@ -117,6 +121,9 @@ } } + public static void NoWait(IPromise promise) { + } + [DebuggerStepThrough] public static IPromise Run(Func> action) { ArgumentNotNull(action, "action"); @@ -128,5 +135,10 @@ } } +#if NET_4_5 + public static void NoWait(Task t) { + } +#endif + } }