File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
- using System ;
1
+ #nullable enable
2
+ using System ;
2
3
using System . Collections . Generic ;
3
4
using System . Threading . Tasks ;
4
5
@@ -24,6 +25,9 @@ public AsyncAutoResetEvent(bool initialState)
24
25
_isSignaled = initialState ;
25
26
}
26
27
28
+ /// <summary>
29
+ /// 析构方法
30
+ /// </summary>
27
31
~ AsyncAutoResetEvent ( )
28
32
{
29
33
Dispose ( ) ;
@@ -68,7 +72,7 @@ public Task<bool> WaitOneAsync()
68
72
/// </summary>
69
73
public void Set ( )
70
74
{
71
- TaskCompletionSource < bool > releaseSource = null ;
75
+ TaskCompletionSource < bool > ? releaseSource = null ;
72
76
bool result ;
73
77
lock ( _locker )
74
78
{
Original file line number Diff line number Diff line change 1
- using System ;
1
+ #nullable enable
2
+ using System ;
2
3
using System . Collections . Concurrent ;
3
4
using System . Collections . Generic ;
4
5
using System . Threading ;
@@ -96,7 +97,7 @@ public async Task<T> DequeueAsync(CancellationToken cancellationToken = default)
96
97
}
97
98
}
98
99
99
- return default ;
100
+ return default ! ;
100
101
}
101
102
102
103
/// <summary>
@@ -175,7 +176,7 @@ private void ThrowIfDisposing()
175
176
}
176
177
}
177
178
178
- private event EventHandler CurrentFinished ;
179
+ private event EventHandler ? CurrentFinished ;
179
180
180
181
private bool _isDisposing ;
181
182
private bool _isDisposed ;
You can’t perform that action at this time.
0 commit comments