Exemple #1
0
        /// <summary>
        ///     对象关闭时登记
        /// </summary>
        public static void OnObjectClose(IService obj)
        {
            Logger.Information("[服务关闭] {0}", obj.ServiceName);
            bool can;

            lock (ActiveObjects)
            {
                ActiveObjects.Remove(obj);
            }
            can = ActiveObjects.Count == 0;
            if (can)
            {
                ActiveSemaphore.Release(); //发出完成信号
            }
        }
Exemple #2
0
        /// <summary>
        ///     对象关闭时登记
        /// </summary>
        public static void OnObjectFailed(IService obj)
        {
            Logger.Information("[OnObjectFailed] {0}", obj.ServiceName);
            bool can;

            lock (FailedObjects)
            {
                FailedObjects.Add(obj);
            }
            can = ActiveObjects.Count + FailedObjects.Count == FlowServices.Length;
            if (can)
            {
                ActiveSemaphore.Release(); //发出完成信号
            }
        }