view Implab/Diagnostics/Extensions.cs @ 98:4c945d94b9ab v2

fix MTQueue syntax error
author cin
date Tue, 04 Nov 2014 09:43:44 +0300
parents a43745f81f10
children 1b7ebcc52e5a
line wrap: on
line source

namespace Implab.Diagnostics {
    public static class Extensions {
        public static IPromise<T> EndLogicalOperation<T>(this IPromise<T> promise) {
            Safe.ArgumentNotNull(promise, "promise");
            var op = TraceContext.Instance.DetachLogicalOperation();

            return promise.Anyway(() => {
                TraceContext.Instance.EnterLogicalOperation(op,true);
                TraceLog.EndLogicalOperation();
                TraceContext.Instance.Leave();
            });
        }

        public static IPromise EndLogicalOperation(this IPromise promise) {
            Safe.ArgumentNotNull(promise, "promise");
            var op = TraceContext.Instance.DetachLogicalOperation();

            return promise.Anyway(() => {
                TraceContext.Instance.EnterLogicalOperation(op,true);
                TraceLog.EndLogicalOperation();
                TraceContext.Instance.Leave();
            });
        }
    }
}