@@ -275,7 +275,7 @@ private class InternalPoolImpl : IDisposable
275
275
private MemcachedNode ownerNode ;
276
276
private readonly EndPoint _endPoint ;
277
277
private readonly TimeSpan queueTimeout ;
278
- private SemaphoreSlim semaphore ;
278
+ private SemaphoreSlim _semaphore ;
279
279
280
280
private readonly object initLock = new Object ( ) ;
281
281
@@ -299,7 +299,7 @@ internal InternalPoolImpl(
299
299
this . minItems = config . MinPoolSize ;
300
300
this . maxItems = config . MaxPoolSize ;
301
301
302
- this . semaphore = new SemaphoreSlim ( maxItems , maxItems ) ;
302
+ _semaphore = new SemaphoreSlim ( maxItems , maxItems ) ;
303
303
this . freeItems = new InterlockedStack < PooledSocket > ( ) ;
304
304
305
305
_logger = logger ;
@@ -410,7 +410,7 @@ public IPooledSocketResult Acquire()
410
410
411
411
PooledSocket retval = null ;
412
412
413
- if ( ! this . semaphore . Wait ( this . queueTimeout ) )
413
+ if ( ! _semaphore . Wait ( this . queueTimeout ) )
414
414
{
415
415
message = "Pool is full, timeouting. " + _endPoint ;
416
416
if ( _isDebugEnabled ) _logger . LogDebug ( message ) ;
@@ -481,7 +481,7 @@ public IPooledSocketResult Acquire()
481
481
// so we need to make sure to release the semaphore, so new connections can be
482
482
// acquired or created (otherwise dead conenctions would "fill up" the pool
483
483
// while the FP pretends that the pool is healthy)
484
- semaphore . Release ( ) ;
484
+ _semaphore . Release ( ) ;
485
485
486
486
this . MarkAsDead ( ) ;
487
487
result . Fail ( message ) ;
@@ -516,7 +516,7 @@ public async Task<IPooledSocketResult> AcquireAsync()
516
516
517
517
PooledSocket retval = null ;
518
518
519
- if ( ! await this . semaphore . WaitAsync ( this . queueTimeout ) )
519
+ if ( ! await _semaphore . WaitAsync ( this . queueTimeout ) )
520
520
{
521
521
message = "Pool is full, timeouting. " + _endPoint ;
522
522
if ( _isDebugEnabled ) _logger . LogDebug ( message ) ;
@@ -588,7 +588,7 @@ public async Task<IPooledSocketResult> AcquireAsync()
588
588
// so we need to make sure to release the semaphore, so new connections can be
589
589
// acquired or created (otherwise dead conenctions would "fill up" the pool
590
590
// while the FP pretends that the pool is healthy)
591
- semaphore . Release ( ) ;
591
+ _semaphore . Release ( ) ;
592
592
593
593
this . MarkAsDead ( ) ;
594
594
result . Fail ( message ) ;
@@ -647,9 +647,9 @@ private void ReleaseSocket(PooledSocket socket)
647
647
finally
648
648
{
649
649
// signal the event so if someone is waiting for it can reuse this item
650
- if ( this . semaphore != null )
650
+ if ( _semaphore != null )
651
651
{
652
- this . semaphore . Release ( ) ;
652
+ _semaphore . Release ( ) ;
653
653
}
654
654
}
655
655
}
@@ -667,9 +667,9 @@ private void ReleaseSocket(PooledSocket socket)
667
667
{
668
668
// make sure to signal the Acquire so it can create a new conenction
669
669
// if the failure policy keeps the pool alive
670
- if ( this . semaphore != null )
670
+ if ( _semaphore != null )
671
671
{
672
- this . semaphore . Release ( ) ;
672
+ _semaphore . Release ( ) ;
673
673
}
674
674
}
675
675
}
@@ -684,9 +684,9 @@ private void ReleaseSocket(PooledSocket socket)
684
684
}
685
685
finally
686
686
{
687
- if ( this . semaphore != null )
687
+ if ( _semaphore != null )
688
688
{
689
- this . semaphore . Release ( ) ;
689
+ _semaphore . Release ( ) ;
690
690
}
691
691
}
692
692
}
@@ -722,8 +722,8 @@ public void Dispose()
722
722
}
723
723
724
724
this . ownerNode = null ;
725
- this . semaphore . Dispose ( ) ;
726
- this . semaphore = null ;
725
+ _semaphore . Dispose ( ) ;
726
+ _semaphore = null ;
727
727
this . freeItems = null ;
728
728
}
729
729
}
0 commit comments