Soenneker.Atomics.ValueLocks 4.0.3

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Atomics.ValueLocks --version 4.0.3
                    
NuGet\Install-Package Soenneker.Atomics.ValueLocks -Version 4.0.3
                    
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="Soenneker.Atomics.ValueLocks" Version="4.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Atomics.ValueLocks" Version="4.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Atomics.ValueLocks" />
                    
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 Soenneker.Atomics.ValueLocks --version 4.0.3
                    
#r "nuget: Soenneker.Atomics.ValueLocks, 4.0.3"
                    
#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 Soenneker.Atomics.ValueLocks@4.0.3
                    
#: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=Soenneker.Atomics.ValueLocks&version=4.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Atomics.ValueLocks&version=4.0.3
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Atomics.ValueLocks

Lightweight value-type synchronization with atomically published lock storage.

Installation

dotnet add package Soenneker.Atomics.ValueLocks

Usage

using Soenneker.Atomics.ValueLocks;

public sealed class Cache
{
    private ValueAtomicLock _sync;

    public void Update()
    {
        lock (_sync.Get())
        {
            // Protected work
        }
    }
}

ValueAtomicLock occupies one reference-sized field and creates its System.Threading.Lock only on first use. It is a mutable struct intended to remain a private field; copying an uninitialized instance can create independent lock domains.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Atomics.ValueLocks:

Package Downloads
Soenneker.Atomics.ValueLazys

Thread-safe lazy initialization without Lazy wrapper allocations.

Soenneker.Atomics.ValueNullableLazys

Allocation-conscious lazy initialization that correctly caches null values.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.10 22,108 9/1/2026
4.0.9 11,270 9/1/2026
4.0.8 476 9/1/2026
4.0.6 8,935 8/29/2026
4.0.5 84 8/29/2026
4.0.4 82 8/29/2026
4.0.3 62,849 8/26/2026
4.0.2 198 8/26/2026