PgLwLockExclusiveGuard<THeader, TElement>
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Holds exclusive read/write access to a lock-protected header and its elements until disposal or callback exit.
public sealed class PgLwLockExclusiveGuard<THeader, TElement> : IDisposable where THeader : unmanaged where TElement : unmanagedType parameters:
THeader
The unmanaged header.
TElement
The unmanaged element.
Writes take effect immediately and are not rolled back by a transaction abort or exception.
Inheritance: object
Implements: IDisposable
Methods
Section titled “Methods”Dispose()
Section titled “Dispose()”Releases this guard once.
public void Dispose()Mutate<TResult>(PgSharedArrayMutator<THeader, TElement, TResult>)
Section titled “Mutate<TResult>(PgSharedArrayMutator<THeader, TElement, TResult>)”Updates the original header and elements through references limited to the synchronous callback.
public TResult Mutate<TResult>(PgSharedArrayMutator<THeader, TElement, TResult> mutator)Type parameters:
TResult
The owned callback result.
Parameters:
mutator — PgSharedArrayMutator<THeader, TElement, TResult>
The mutator, whose references cannot escape the callback.
Returns: TResult
The callback result.
Read<TResult>(PgSharedArrayReader<THeader, TElement, TResult>)
Section titled “Read<TResult>(PgSharedArrayReader<THeader, TElement, TResult>)”Reads the original header and elements through references limited to the synchronous callback.
public TResult Read<TResult>(PgSharedArrayReader<THeader, TElement, TResult> reader)Type parameters:
TResult
The owned callback result.
Parameters:
reader — PgSharedArrayReader<THeader, TElement, TResult>
The reader, whose references cannot escape the callback.
Returns: TResult
The callback result.
Properties
Section titled “Properties”Header
Section titled “Header”Gets or sets a copy of the header while this guard holds the lock.
public THeader Header { get; set; }Value: THeader
this[int]
Section titled “this[int]”Gets or sets a copy of an element while this guard holds the lock.
public TElement this[int index] { get; set; }Parameters:
index — int
The zero-based element index.
Value: TElement
The element.
Length
Section titled “Length”Gets the number of elements.
public int Length { get; }Value: int