Table of Contents

Method TryAcquire

Namespace
LMKit.Model
Assembly
LM-Kit.NET.dll

TryAcquire(string, TimeSpan, out IDisposable)

Acquires the materialization lock for one destination file if it lands within timeout; returns false, with no waiter left behind, when another process still holds it at the deadline. For a caller that must answer rather than wait out a transfer (a delete, a probe): it never sits through a multi-hour pull, and it leaves nothing polling the volume once it has given up. Dispose handle after the write attempt.

public static bool TryAcquire(string destinationPath, TimeSpan timeout, out IDisposable handle)

Parameters

destinationPath string

The model file's final local path.

timeout TimeSpan

How long to keep trying before giving up.

handle IDisposable

The lock to dispose when the attempt is over; null when the lock was not acquired.

Returns

bool
Share