@@ -25,6 +25,8 @@ public class AsyncLock
25
25
/// </param>
26
26
/// <param name="cancellation">The CancellationToken token to observe.</param>
27
27
/// <returns>A task that returns <see cref="IDisposable"/> to release the lock.</returns>
28
+ /// <exception cref="OperationCanceledException">The token has had cancellation requested.</exception>
29
+ /// <exception cref="TimeoutException">The timeout has expired.</exception>
28
30
[ NotNull , ItemNotNull ]
29
31
public async Task < IDisposable > AcquireAsync ( TimeSpan timeout , CancellationToken cancellation )
30
32
{
@@ -46,6 +48,8 @@ public async Task<IDisposable> AcquireAsync(TimeSpan timeout, CancellationToken
46
48
/// </param>
47
49
/// <param name="cancellation">The CancellationToken token to observe.</param>
48
50
/// <returns>A task that returns <see cref="IDisposable"/> to release the lock.</returns>
51
+ /// <exception cref="OperationCanceledException">The token has had cancellation requested.</exception>
52
+ /// <exception cref="TimeoutException">The timeout has expired.</exception>
49
53
[ NotNull , ItemNotNull ]
50
54
public Task < IDisposable > AcquireAsync ( int timeout , CancellationToken cancellation ) =>
51
55
AcquireAsync ( TimeSpan . FromMilliseconds ( timeout ) , cancellation ) ;
@@ -58,6 +62,7 @@ public Task<IDisposable> AcquireAsync(int timeout, CancellationToken cancellatio
58
62
/// indefinitely, or a 0 to return immediately.
59
63
/// </param>
60
64
/// <returns>A task that returns <see cref="IDisposable"/> to release the lock.</returns>
65
+ /// <exception cref="TimeoutException">The timeout has expired.</exception>
61
66
[ NotNull , ItemNotNull ]
62
67
public Task < IDisposable > AcquireAsync ( int timeout ) => AcquireAsync ( TimeSpan . FromMilliseconds ( timeout ) , CancellationToken . None ) ;
63
68
@@ -70,6 +75,7 @@ public Task<IDisposable> AcquireAsync(int timeout, CancellationToken cancellatio
70
75
/// to return immediately.
71
76
/// </param>
72
77
/// <returns>A task that returns <see cref="IDisposable"/> to release the lock.</returns>
78
+ /// <exception cref="TimeoutException">The timeout has expired.</exception>
73
79
[ NotNull , ItemNotNull ]
74
80
public Task < IDisposable > AcquireAsync ( TimeSpan timeout ) => AcquireAsync ( timeout , CancellationToken . None ) ;
75
81
@@ -78,6 +84,7 @@ public Task<IDisposable> AcquireAsync(int timeout, CancellationToken cancellatio
78
84
/// </summary>
79
85
/// <param name="cancellation">The CancellationToken token to observe.</param>
80
86
/// <returns>A task that returns <see cref="IDisposable"/> to release the lock.</returns>
87
+ /// <exception cref="OperationCanceledException">The token has had cancellation requested.</exception>
81
88
[ NotNull , ItemNotNull ]
82
89
public Task < IDisposable > AcquireAsync ( CancellationToken cancellation ) => AcquireAsync ( - 1 , cancellation ) ;
83
90
0 commit comments