From 69f872ced11065127e1d1b928541274b2835a775 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Fri, 31 May 2019 13:33:21 -0400 Subject: [PATCH 1/4] feat: Adding features to IcdEnvironment for tracking program initialization state --- ICD.Common.Utils/IcdEnvironment.cs | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/ICD.Common.Utils/IcdEnvironment.cs b/ICD.Common.Utils/IcdEnvironment.cs index f0d6a36..1804ed5 100644 --- a/ICD.Common.Utils/IcdEnvironment.cs +++ b/ICD.Common.Utils/IcdEnvironment.cs @@ -1,4 +1,6 @@ using System; +using ICD.Common.Properties; +using ICD.Common.Utils.Extensions; namespace ICD.Common.Utils { @@ -54,5 +56,41 @@ namespace ICD.Common.Utils public static event ProgramStatusCallback OnProgramStatusEvent; public static event EthernetEventCallback OnEthernetEvent; + + /// + /// Raised when the program has completed initialization. + /// + public static event EventHandler OnProgramInitializationComplete; + + private static readonly SafeCriticalSection s_ProgramInitializationSection = new SafeCriticalSection(); + private static bool s_ProgramInitializationComplete; + + /// + /// Returns true if the program has been flagged as completely initialized. + /// + public static bool ProgramIsInitialized { get { return s_ProgramInitializationSection.Execute(() => s_ProgramInitializationComplete); } } + + /// + /// Called by the program entry point to signify that the program initialization is complete. + /// + [PublicAPI] + public static void SetProgramInitializationComplete() + { + s_ProgramInitializationSection.Enter(); + + try + { + if (s_ProgramInitializationComplete) + return; + + s_ProgramInitializationComplete = true; + } + finally + { + s_ProgramInitializationSection.Leave(); + } + + OnProgramInitializationComplete.Raise(null); + } } } From 4953e40f9e04a07a3ca883c758892e0401db5338 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Fri, 31 May 2019 13:34:29 -0400 Subject: [PATCH 2/4] docs: Updating changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc7dfc7..bcead0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + - Adding features to IcdEnvironment for tracking program initialization state + ## [8.4.0] - 2019-05-15 ### Added - Added GUID utils for generating seeded GUIDs From ead365e251fc2c3a2cd41e2f16ce32cc7010ab4a Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Thu, 6 Jun 2019 15:51:53 -0400 Subject: [PATCH 3/4] chore: Fixing bad merge --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2d0e49..14da3b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] -### Changed - - Caching the program/processor start time and calculating the uptime from those values instead of polling the crestron processor - -## [8.4.1] - 2019-06-05 ### Added - Adding features to IcdEnvironment for tracking program initialization state +## [8.4.1] - 2019-06-05 +### Changed + - Caching the program/processor start time and calculating the uptime from those values instead of polling the crestron processor + ## [8.4.0] - 2019-05-15 ### Added - Added GUID utils for generating seeded GUIDs From 6526b2b811d5365f5ad33d5b9ba130dfd9adcc6f Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Thu, 6 Jun 2019 15:52:35 -0400 Subject: [PATCH 4/4] chore: Updating changelog, incrementing minor version --- CHANGELOG.md | 1 + ICD.Common.Utils/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14da3b8..8340c01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [8.5.0] - 2019-06-06 ### Added - Adding features to IcdEnvironment for tracking program initialization state diff --git a/ICD.Common.Utils/Properties/AssemblyInfo.cs b/ICD.Common.Utils/Properties/AssemblyInfo.cs index 8cc5446..9b3c993 100644 --- a/ICD.Common.Utils/Properties/AssemblyInfo.cs +++ b/ICD.Common.Utils/Properties/AssemblyInfo.cs @@ -4,4 +4,4 @@ using System.Reflection; [assembly: AssemblyCompany("ICD Systems")] [assembly: AssemblyProduct("ICD.Common.Utils")] [assembly: AssemblyCopyright("Copyright © ICD Systems 2019")] -[assembly: AssemblyVersion("8.4.1.0")] +[assembly: AssemblyVersion("8.5.0.0")]