Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .nuget/Cuemon.Extensions.Threading/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
Version 8.3.2
Version 9.0.0
Availability: .NET 9, .NET 8, .NET 6 and .NET Standard 2.0

# ALM
- CHANGED Dependencies to latest and greatest with respect to TFMs

# New Features
- ADDED support for System.Threading.Lock object that targets .NET TFM prior to .NET 9 (credits to Mark Cilia Vincenti, https://github.com/MarkCiliaVincenti/Backport.System.Threading.Lock)

Version 8.3.2
Availability: .NET 8, .NET 6 and .NET Standard 2.0

# ALM
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ New features:
- FailureConverter class in the Cuemon.Extensions.Newtonsoft.Json.Converters namespace to convert FailureConverter to JSON
- FailureConverter class in the Cuemon.Extensions.Text.Json.Converters namespace to convert FailureConverter to JSON
- FailureConverter class in the Cuemon.Xml.Serialization.Converters namespace to convert FailureConverter to XML
- Support for System.Threading.Lock object that targets TFMs prior to .NET 9 (credits to Mark Cilia Vincenti, https://github.com/MarkCiliaVincenti/Backport.System.Threading.Lock)

### Changed

Expand Down
4 changes: 0 additions & 4 deletions src/Cuemon.Core/Cuemon.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@
<PackageTags>action-factory bit-unit byte-unit binary-prefix decimal-prefix prefix-multiple multiple-table calculator configure configure-revert configure-exchange configurable condition options-pattern data-reader decorator delimited-string disposable finalize-disposable safe-invoke safe-invoke-async func-factory patterns reference-project clean-architecture clean-code task-action-factory task-func-factory template template-factory time-range time-unit validator guard text-encoding parser-factory security aes-cryptor cyclic-redundancy-check fowler-noll-vo-hash hash-factory hash-result hmac-message-digest hmac-secure-hash-algorithm keyed-crypto-hash keyed-crypto-algorithm message-digest non-crypto-algorithm secure-hash-algorithm unkeyed-crypto-hash</PackageTags>
</PropertyGroup>

<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
<Compile Remove="Threading\Lock.cs" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/Cuemon.Core/Runtime/Dependency.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Cuemon.Runtime
Expand All @@ -13,7 +12,7 @@ public abstract class Dependency : IDependency
{
private IEnumerable<IWatcher> _watchers;
private readonly Func<EventHandler<WatcherEventArgs>, IEnumerable<IWatcher>> _watchersHandler;
private readonly Lock _locker = new();
private readonly object _locker = new();

/// <summary>
/// Initializes a new instance of the <see cref="Dependency" /> class.
Expand Down
3 changes: 1 addition & 2 deletions src/Cuemon.Core/Runtime/FileWatcher.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Cuemon.Security;

Expand All @@ -12,7 +11,7 @@ namespace Cuemon.Runtime
/// <seealso cref="Watcher" />
public class FileWatcher : Watcher
{
private readonly Lock _locker = new();
private readonly object _locker = new();

/// <summary>
/// Initializes a new instance of the <see cref="FileWatcher"/> class.
Expand Down
2 changes: 1 addition & 1 deletion src/Cuemon.Core/Runtime/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Cuemon.Runtime
/// </summary>
public abstract class Watcher : Disposable, IWatcher
{
private readonly Lock _locker = new();
private readonly object _locker = new();
private Timer _watcherTimer;
private Timer _watcherPostponingTimer;

Expand Down
139 changes: 0 additions & 139 deletions src/Cuemon.Core/Threading/Lock.cs

This file was deleted.

3 changes: 1 addition & 2 deletions src/Cuemon.Data/BulkCopyDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;

namespace Cuemon.Data
{
Expand All @@ -15,7 +14,7 @@ namespace Cuemon.Data
/// </summary>
public sealed class BulkCopyDataReader : DbDataReader
{
private static readonly Lock PadLock = new();
private static readonly object PadLock = new();
private IOrderedDictionary _defaultFields;

/// <summary>
Expand Down
3 changes: 1 addition & 2 deletions src/Cuemon.Data/DatabaseWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Cuemon.Runtime;
using Cuemon.Security;
Expand All @@ -15,7 +14,7 @@ namespace Cuemon.Data
/// <seealso cref="Watcher" />
public class DatabaseWatcher : Watcher
{
private readonly Lock _locker = new();
private readonly object _locker = new();

/// <summary>
/// Initializes a new instance of the <see cref="DatabaseWatcher"/> class.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using Cuemon.Extensions.AspNetCore.Newtonsoft.Json.Converters;
using Cuemon.Extensions.Newtonsoft.Json.Formatters;
using System.Threading;

namespace Cuemon.Extensions.AspNetCore.Newtonsoft.Json
{
internal static class Bootstrapper
{
private static readonly Lock PadLock = new();
private static readonly object PadLock = new();
private static bool _initialized;

internal static void Initialize()
Expand Down
3 changes: 1 addition & 2 deletions src/Cuemon.Extensions.AspNetCore.Text.Json/Bootstrapper.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using Cuemon.Extensions.AspNetCore.Text.Json.Converters;
using Cuemon.Extensions.Text.Json.Formatters;
using System.Threading;

namespace Cuemon.Extensions.AspNetCore.Text.Json
{
internal static class Bootstrapper
{
private static readonly Lock PadLock = new();
private static readonly object PadLock = new();
private static bool _initialized;

internal static void Initialize()
Expand Down
3 changes: 1 addition & 2 deletions src/Cuemon.Extensions.AspNetCore.Xml/Bootstrapper.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using Cuemon.Extensions.AspNetCore.Xml.Converters;
using Cuemon.Xml.Serialization.Formatters;
using System.Threading;

namespace Cuemon.Extensions.AspNetCore.Xml
{
internal static class Bootstrapper
{
private static readonly Lock PadLock = new();
private static readonly object PadLock = new();
private static bool _initialized;

internal static void Initialize()
Expand Down
2 changes: 1 addition & 1 deletion src/Cuemon.Extensions.Net/Http/SlimHttpClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class SlimHttpClientFactory : IHttpClientFactory
private readonly ConcurrentDictionary<string, Lazy<ActiveHandler>> _activeHandlers = new();
private readonly ConcurrentQueue<ExpiredHandler> _expiredHandlers = new();
private readonly Func<HttpClientHandler> _handlerFactory;
private readonly Lock _locker = new();
private readonly object _locker = new();
private readonly SlimHttpClientFactoryOptions _options;
internal static readonly TimeSpan ExpirationTimerDueTime = TimeSpan.FromSeconds(15);
private Timer _expirationTimer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Reflection;
using System.Threading;
using Cuemon.Configuration;
using Cuemon.Diagnostics;
using Cuemon.Extensions.Newtonsoft.Json.Converters;
Expand All @@ -17,7 +16,7 @@ namespace Cuemon.Extensions.Newtonsoft.Json.Formatters
/// </summary>
public class NewtonsoftJsonFormatterOptions : IExceptionDescriptorOptions, IContentNegotiation, IValidatableParameterObject
{
private readonly Lock _locker = new();
private readonly object _locker = new();
private bool _refreshed;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Threading;
using Cuemon.Collections.Generic;
using Cuemon.Reflection;
using Cuemon.Runtime;
Expand Down Expand Up @@ -707,7 +706,7 @@ public static Func<T1, T2, T3, T4, T5, TResult> Memoize<TKey, T1, T2, T3, T4, T5
};
}

private static readonly Lock PadLock = new();
private static readonly object PadLock = new();

private static TResult Memoize<TKey, TTuple, TResult>(ICacheEnumerable<TKey> cache, string key, CacheInvalidation invalidation, FuncFactory<TTuple, TResult> valueFactory) where TTuple : Template
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using Cuemon.Configuration;
using Cuemon.Diagnostics;
using Cuemon.Extensions.Text.Json.Converters;
Expand All @@ -17,7 +16,7 @@ namespace Cuemon.Extensions.Text.Json.Formatters
/// </summary>
public class JsonFormatterOptions : IContentNegotiation, IExceptionDescriptorOptions, IValidatableParameterObject
{
private readonly Lock _locker = new();
private readonly object _locker = new();
private bool _refreshed;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@
<ProjectReference Include="..\Cuemon.Threading\Cuemon.Threading.csproj" />
</ItemGroup>

</Project>
<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="2.0.0" />
<Using Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Alias="Lock" Include="System.Threading.Lock" />
<Using Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Alias="Lock" Include="Backport.System.Threading.Lock" />
<Using Alias="LockFactory" Include="Backport.System.Threading.LockFactory" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Threading;
using Cuemon.Configuration;
using Cuemon.Diagnostics;
using Cuemon.Extensions.YamlDotNet.Converters;
Expand All @@ -16,7 +15,7 @@ namespace Cuemon.Extensions.YamlDotNet.Formatters
/// </summary>
public class YamlFormatterOptions : EncodingOptions, IExceptionDescriptorOptions, IContentNegotiation, IValidatableParameterObject
{
private readonly Lock _locker = new();
private readonly object _locker = new();
private bool _refreshed;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Threading;
using Cuemon.Configuration;
using Cuemon.Diagnostics;
using Cuemon.Net.Http;
Expand All @@ -14,7 +13,7 @@ namespace Cuemon.Xml.Serialization.Formatters
/// </summary>
public class XmlFormatterOptions : IExceptionDescriptorOptions, IContentNegotiation, IValidatableParameterObject
{
private readonly Lock _locker = new();
private readonly object _locker = new();
private bool _refreshed;

/// <summary>
Expand Down