示例#1
0
文件: Daemon.cs 项目: erxdkh/azos
        /// <summary>
        /// Allows to abort unsuccessful DoStart() overridden implementation.
        /// This method must be called from within DoStart()
        /// </summary>
        protected void AbortStart()
        {
            var trace = new StackTrace(1, false);

            if (!trace.GetFrames().Any(f => f.GetMethod().Name.Equals("DoStart", StringComparison.Ordinal)))
            {
                Debugging.Fail(
                    text: "Daemon.AbortStart() must be called from within DoStart()",
                    action: DebugAction.ThrowAndLog);
            }

            m_Status = DaemonStatus.AbortingStart;
        }