@@ -180,19 +180,19 @@ public void TestChannelShutdownDoesNotShutDownDispatcher()
180
180
private class ShutdownLatchConsumer : DefaultBasicConsumer
181
181
{
182
182
public ManualResetEvent Latch { get ; private set ; }
183
- public ManualResetEvent LatchDuplicate { get ; private set ; }
183
+ public ManualResetEvent DuplicateLatch { get ; private set ; }
184
184
185
- public ShutdownLatchConsumer ( ManualResetEvent latch , ManualResetEvent latchDuplicate )
185
+ public ShutdownLatchConsumer ( ManualResetEvent latch , ManualResetEvent duplicateLatch )
186
186
{
187
187
this . Latch = latch ;
188
- this . LatchDuplicate = latchDuplicate ;
188
+ this . DuplicateLatch = duplicateLatch ;
189
189
}
190
190
191
191
public override void HandleModelShutdown ( object model , ShutdownEventArgs reason )
192
192
{
193
- // If Latch is already set - event is duplicate
193
+ // keep track of duplicates
194
194
if ( this . Latch . WaitOne ( 0 ) ) {
195
- this . LatchDuplicate . Set ( ) ;
195
+ this . DuplicateLatch . Set ( ) ;
196
196
} else {
197
197
this . Latch . Set ( ) ;
198
198
}
@@ -203,15 +203,15 @@ public override void HandleModelShutdown(object model, ShutdownEventArgs reason)
203
203
public void TestModelShutdownHandler ( )
204
204
{
205
205
var latch = new ManualResetEvent ( false ) ;
206
- var latchDuplicate = new ManualResetEvent ( false ) ;
206
+ var duplicateLatch = new ManualResetEvent ( false ) ;
207
207
var q = this . Model . QueueDeclare ( ) . QueueName ;
208
- var c = new ShutdownLatchConsumer ( latch , latchDuplicate ) ;
208
+ var c = new ShutdownLatchConsumer ( latch , duplicateLatch ) ;
209
209
210
210
this . Model . BasicConsume ( queue : q , noAck : true , consumer : c ) ;
211
211
this . Model . Close ( ) ;
212
212
Wait ( latch , TimeSpan . FromSeconds ( 5 ) ) ;
213
- Assert . IsFalse ( latchDuplicate . WaitOne ( TimeSpan . FromSeconds ( 5 ) ) ,
214
- "duplicate events " ) ;
213
+ Assert . IsFalse ( duplicateLatch . WaitOne ( TimeSpan . FromSeconds ( 5 ) ) ,
214
+ "event handler fired more than once " ) ;
215
215
}
216
216
}
217
217
}
0 commit comments