diff --git a/Backport.System.Threading.Lock/Lock.cs b/Backport.System.Threading.Lock/Lock.cs index 0227e8a..1b6169c 100644 --- a/Backport.System.Threading.Lock/Lock.cs +++ b/Backport.System.Threading.Lock/Lock.cs @@ -1,6 +1,8 @@ using System.Runtime.CompilerServices; + #if NET5_0_OR_GREATER && !NET9_0_OR_GREATER namespace System.Threading; + /// /// A backport of .NET 9.0+'s System.Threading.Lock. Provides a way to get mutual exclusion in regions of code between different threads. /// A lock may be held by one thread at a time. diff --git a/Backport.System.Threading.Lock/LockFactory.cs b/Backport.System.Threading.Lock/LockFactory.cs index 65fd52e..fd8ac84 100644 --- a/Backport.System.Threading.Lock/LockFactory.cs +++ b/Backport.System.Threading.Lock/LockFactory.cs @@ -1,34 +1,33 @@ using FrameworkNamespace = System.Threading; -namespace Backport.System.Threading -{ +namespace Backport.System.Threading; + #if NET9_0_OR_GREATER +/// +/// Represents a factory class for backporting .NET 9.0's System.Threading.Lock to prior framework versions. +/// If your project does not target anything before .NET 5.0, you do not need to use this; simply use . +/// +public static class LockFactory +{ /// - /// Represents a factory class for backporting .NET 9.0's System.Threading.Lock to prior framework versions. + /// Creates a new instance of . On frameworks prior to .NET 9.0, a different backported class is returned. /// If your project does not target anything before .NET 5.0, you do not need to use this; simply use . /// - public static class LockFactory - { - /// - /// Creates a new instance of . On frameworks prior to .NET 9.0, a different backported class is returned. - /// If your project does not target anything before .NET 5.0, you do not need to use this; simply use . - /// - /// An instance of . - public static FrameworkNamespace.Lock Create() => new(); - } + /// An instance of . + public static FrameworkNamespace.Lock Create() => new(); +} #else +/// +/// Represents a factory class for backporting .NET 9.0's System.Threading.Lock to prior framework versions. +/// If your project does not target anything before .NET 5.0, you do not need to use this; simply use System.Threading.Lock. +/// +public static class LockFactory +{ /// - /// Represents a factory class for backporting .NET 9.0's System.Threading.Lock to prior framework versions. + /// Creates a new instance of . On .NET 9.0 or later, an instance of System.Threading.Lock is returned. /// If your project does not target anything before .NET 5.0, you do not need to use this; simply use System.Threading.Lock. /// - public static class LockFactory - { - /// - /// Creates a new instance of . On .NET 9.0 or later, an instance of System.Threading.Lock is returned. - /// If your project does not target anything before .NET 5.0, you do not need to use this; simply use System.Threading.Lock. - /// - /// An instance of . - public static Lock Create() => new(); - } -#endif + /// An instance of . + public static Lock Create() => new(); } +#endif \ No newline at end of file diff --git a/Backport.System.Threading.Lock/PreNet5Lock.cs b/Backport.System.Threading.Lock/PreNet5Lock.cs index 6c53425..db4710e 100644 --- a/Backport.System.Threading.Lock/PreNet5Lock.cs +++ b/Backport.System.Threading.Lock/PreNet5Lock.cs @@ -2,7 +2,9 @@ using System; using System.Runtime.CompilerServices; using System.Threading; + namespace Backport.System.Threading; + /// /// A backport of .NET 9.0+'s System.Threading.Lock. Provides a way to get mutual exclusion in regions of code between different threads. /// A lock may be held by one thread at a time. Do not try and create an instance of this class; use .