PgLwLockShareGuard<T>
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Holds shared read access to a PostgreSQL shared-memory value until disposal or callback exit.
public sealed class PgLwLockShareGuard<T> : IDisposable where T : unmanagedType parameters:
T
The unmanaged shared value.
Inheritance: object
Implements: IDisposable
Methods
Section titled “Methods”Dispose()
Section titled “Dispose()”Releases this guard once without modifying the shared value.
public void Dispose()Read<TResult>(PgSharedReader<T, TResult>)
Section titled “Read<TResult>(PgSharedReader<T, TResult>)”Reads original protected storage through a reference limited to the synchronous callback.
public TResult Read<TResult>(PgSharedReader<T, TResult> reader)Type parameters:
TResult
The owned callback result.
Parameters:
reader — PgSharedReader<T, TResult>
The reader, whose readonly reference cannot escape the callback.
Returns: TResult
The callback result.
Access nested atomic and spinlock fields directly through this reference. Child spinlock guards expire before the read ends. Disposing this guard and calling backend APIs are rejected while a reader is active, so PostgreSQL cannot release its lock beneath the borrowed reference.
Properties
Section titled “Properties”Gets a copy of the shared value while this guard holds the lock.
public T Value { get; }Value: T