PgSpinLock<T>
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Owns stable local storage for a value protected by a PostgreSQL spinlock.
public sealed class PgSpinLock<T> where T : unmanagedType parameters:
T
The unmanaged protected value.
This local owner pins its storage for its managed lifetime. Use PgSpinLockValue inside PgShared for cross-process storage. Construction and access require the owning backend’s native callback. Prefer PgLwLock for work longer than a few instructions.
Inheritance: object
Constructors
Section titled “Constructors”PgSpinLock(T)
Section titled “PgSpinLock(T)”Creates stable local storage and initializes its selected-header native spinlock.
public PgSpinLock(T value)Parameters:
value — T
The initial protected value.
Properties
Section titled “Properties”IsLocked
Section titled “IsLocked”Gets an instantaneous lock-state observation on PostgreSQL versions before 19.
public bool IsLocked { get; }Value: bool
Methods
Section titled “Methods”Lock()
Section titled “Lock()”Acquires exclusive access until disposal or callback exit.
public PgSpinLockGuard<T> Lock()Returns: PgSpinLockGuard<T>
The checked guard, which keeps this owner’s storage alive.