Meziantou.Framework.Threading 3.1.7

Prefix Reserved
dotnet add package Meziantou.Framework.Threading --version 3.1.7
                    
NuGet\Install-Package Meziantou.Framework.Threading -Version 3.1.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meziantou.Framework.Threading" Version="3.1.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.Threading" Version="3.1.7" />
                    
Directory.Packages.props
<PackageReference Include="Meziantou.Framework.Threading" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Meziantou.Framework.Threading --version 3.1.7
                    
#r "nuget: Meziantou.Framework.Threading, 3.1.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Meziantou.Framework.Threading@3.1.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Meziantou.Framework.Threading&version=3.1.7
                    
Install as a Cake Addin
#tool nuget:?package=Meziantou.Framework.Threading&version=3.1.7
                    
Install as a Cake Tool

Meziantou.Framework.Threading

Provides types such as

  • ConcurrentHashSet<T>
  • ConcurrentObservableCollection<T>
  • SynchronizedList<T>
  • AsyncAutoResetEvent
  • AsyncLock
  • ResettableCancellationTokenSource
  • KeyedLock
  • KeyedAsyncLock

Provides extensions methods for

  • SemaphoreSlim
  • Task

Simplifying task awaiting (blog post). The extension methods are in the Meziantou.Framework.Threading.Tasks namespace.

var task1 = Task.FromResult(42);
var task2 = Task.FromResult("value");

var (a, b) = await (task1, task2);
Assert.Equal(42, a);
Assert.Equal("value", b);

var (c, d) = await (task1, task2).ConfigureAwait(false);
Assert.Equal(42, c);
Assert.Equal("value", d);

Thread-safe collection that can be bound to a UI control (ConcurrentObservableCollection<T> is in the Meziantou.Framework.Collections.Concurrent namespace)

// Created on the UI thread, so the notifications are raised on that thread
var collection = new ConcurrentObservableCollection<string>();
listBox.ItemsSource = collection.AsObservable;

// The collection itself is safe to use from any thread
await Task.Run(() => collection.Add("Item from a background thread"));

The thread the notifications are raised on can also be set explicitly with a SynchronizationContext:

var collection = new ConcurrentObservableCollection<string>(synchronizationContext);
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Meziantou.Framework.Threading:

Package Downloads
ANcpLua.Roslyn.Utilities.Testing

Fluent testing framework for Roslyn analyzers, code fixes, and incremental generators with caching validation, forbidden type detection, and comprehensive assertion support.

ANcpLua.Roslyn.Utilities.Testing.MSBuild

Framework-independent project, process, and MSBuild test helpers.

ANcpLua.Roslyn.Utilities.Testing.Xunit

Opt-in Xunit integrations for ANcpLua Roslyn testing utilities.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.7 71 10/21/2026
3.1.6 950 9/27/2026
3.1.5 500 9/20/2026
3.1.4 305 9/13/2026
3.1.3 248 9/11/2026
3.1.2 440 9/6/2026
3.1.1 459 9/3/2026
3.1.0 1,124 8/20/2026
3.0.0 3,618 7/5/2026
2.0.10 302 7/5/2026
2.0.9 974 6/13/2026
2.0.8 281 6/7/2026
2.0.7 3,075 5/31/2026
2.0.6 520 5/23/2026
2.0.5 4,989 4/25/2026
2.0.4 21,130 1/18/2026
2.0.3 11,355 11/2/2025
2.0.2 6,573 9/3/2025
2.0.1 6,398 8/17/2025
2.0.0 10,202 4/27/2025
Loading failed