File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -136,9 +136,9 @@ public IPooledSocketResult Acquire()
136136 this . internalPoolImpl . InitPool ( ) ;
137137 this . isInitialized = true ;
138138 _logger . LogInformation ( "MemcachedInitPool-cost: {0}ms" , ( DateTime . Now - startTime ) . TotalMilliseconds ) ;
139- poolInitSemaphore . Release ( ) ;
140139 }
141140 }
141+
142142 try
143143 {
144144 return this . internalPoolImpl . Acquire ( ) ;
@@ -151,6 +151,10 @@ public IPooledSocketResult Acquire()
151151 result . Fail ( message , e ) ;
152152 return result ;
153153 }
154+ finally
155+ {
156+ poolInitSemaphore . Release ( ) ;
157+ }
154158 }
155159
156160 /// <summary>
@@ -210,6 +214,7 @@ public void Dispose()
210214
211215 this . isDisposed = true ;
212216 this . internalPoolImpl . Dispose ( ) ;
217+ this . poolInitSemaphore . Dispose ( ) ;
213218 }
214219 }
215220
You can’t perform that action at this time.
0 commit comments