Soenneker.Atomics.ValueLocks
4.0.5
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Soenneker.Atomics.ValueLocks --version 4.0.5
NuGet\Install-Package Soenneker.Atomics.ValueLocks -Version 4.0.5
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.5" />
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.5" />
<PackageReference Include="Soenneker.Atomics.ValueLocks" />
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.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Atomics.ValueLocks, 4.0.5"
#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.5
#: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.5
#tool nuget:?package=Soenneker.Atomics.ValueLocks&version=4.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Atomics.ValueLocks
Provides inline storage for a lazily created, atomically published Lock.
Install
dotnet add package Soenneker.Atomics.ValueLocks
What you get
ValueAtomicLock— Provides inline storage for a lazily created, atomically publishedLock.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
ValueAtomicLock.IsValueCreated |
Gets a value indicating whether the lock has been created. | Gets a value indicating whether the lock has been created. |
ValueAtomicLock.Value |
Gets the single published lock, creating it if necessary. | Gets the single published lock, creating it if necessary. |
ValueAtomicLock.Get() |
Gets the single published lock, creating and atomically publishing it when uninitialized. | The requested lock. |
Important behavior
ValueAtomicLock: The default value is ready to use and does not allocate untilGetis first called. Concurrent callers may create temporary candidates, but every caller receives the single published lock. This is a mutablestructintended for use as a private field. Avoid copying it before initialization because each copy can publish a different lock and therefore establish a different lock domain.
| Product | Versions 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.ValueNullableLazys
Allocation-conscious lazy initialization that correctly caches null values. |
|
|
Soenneker.Atomics.ValueLazys
Thread-safe lazy initialization without Lazy wrapper allocations. |
GitHub repositories
This package is not used by any popular GitHub repositories.