Synced
FileLease.AcquireSharedAsync
Section titled “FileLease.AcquireSharedAsync”
- Pins an existing generation against exclusive retirement while permitting other readers.
Required contracts
Section titled “Required contracts”API: engine
Project: Inno.Core.IO
Declaration
Section titled “Declaration”public static System.Threading.Tasks.ValueTask<Inno.Core.IO.FileLease> Inno.Core.IO.FileLease.AcquireSharedAsync(string path, System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))Parameters
Section titled “Parameters”Parameter path: The absolute persistent lease path previously initialized by an exclusive owner.
Parameter timeout: The maximum wait, or F:System.Threading.Timeout.InfiniteTimeSpan for no time limit.
Parameter cancellationToken: Cancels waiting before ownership is returned.
Returns
Section titled “Returns”A shared lease; an exclusive lease cannot be acquired until every reader releases ownership.
Exceptions
Section titled “Exceptions”Exception T:System.IO.FileNotFoundException: The owner has not initialized the persistent lease file.
Exception T:System.TimeoutException: An exclusive owner retains the file beyond the permitted wait.
Exception T:System.OperationCanceledException: Waiting was canceled; no lease is returned.