/// <summary>Defines possible states for <see cref="_singleBufferHandleState"/> in order to faciliate correct cleanup of any pinned state.</summary>
privateenumSingleBufferHandleState:byte
{
/// <summary>No operation using <see cref="_singleBufferHandle"/> is in flight, and no cleanup of <see cref="_singleBufferHandle"/> is required.</summary>
None,
/// <summary>
/// An operation potentially using <see cref="_singleBufferHandle"/> is in flight, but the field hasn't yet been initialized.
/// It's possible <see cref="_singleBufferHandle"/> will transition to <see cref="Set"/>, and thus code needs to wait for the
/// value to no longer be <see cref="InProcess"/> before <see cref="_singleBufferHandle"/> can be disposed.
/// </summary>
InProcess,
/// <summary>The <see cref="_singleBufferHandle"/> field has been initialized and requires disposal. It is safe to dispose of when the operation no longer needs it.</summary>
Set
}
// BufferList property variables.
// Note that these arrays are allocated and then grown as necessary, but never shrunk.
Debug.Assert(_singleBufferHandleState==SingleBufferHandleState.InProcess,"An operation must be declared in-flight in order to register to cancel it.");