File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
projects/RabbitMQ.Client/client/impl Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ namespace RabbitMQ.Client.client.impl
3939 sealed class AsyncManualResetEvent : IValueTaskSource
4040 {
4141 private ManualResetValueTaskSourceCore < bool > _valueTaskSource ;
42- private volatile bool _isSet ;
42+ private bool _isSet ;
4343
4444 public AsyncManualResetEvent ( bool initialState = false )
4545 {
@@ -51,7 +51,7 @@ public AsyncManualResetEvent(bool initialState = false)
5151 }
5252 }
5353
54- public bool IsSet => _isSet ;
54+ public bool IsSet => Volatile . Read ( ref _isSet ) ;
5555
5656 public async ValueTask WaitAsync ( CancellationToken cancellationToken )
5757 {
@@ -97,23 +97,23 @@ await tokenRegistration.DisposeAsync()
9797
9898 public void Set ( )
9999 {
100- if ( _isSet )
100+ if ( IsSet )
101101 {
102102 return ;
103103 }
104104
105- _isSet = true ;
105+ Volatile . Write ( ref _isSet , true ) ;
106106 _valueTaskSource . SetResult ( true ) ;
107107 }
108108
109109 public void Reset ( )
110110 {
111- if ( ! _isSet )
111+ if ( ! IsSet )
112112 {
113113 return ;
114114 }
115115
116- _isSet = false ;
116+ Volatile . Write ( ref _isSet , false ) ;
117117 _valueTaskSource . Reset ( ) ;
118118 }
119119
You can’t perform that action at this time.
0 commit comments