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()
136
136
this . internalPoolImpl . InitPool ( ) ;
137
137
this . isInitialized = true ;
138
138
_logger . LogInformation ( "MemcachedInitPool-cost: {0}ms" , ( DateTime . Now - startTime ) . TotalMilliseconds ) ;
139
- poolInitSemaphore . Release ( ) ;
140
139
}
141
140
}
141
+
142
142
try
143
143
{
144
144
return this . internalPoolImpl . Acquire ( ) ;
@@ -151,6 +151,10 @@ public IPooledSocketResult Acquire()
151
151
result . Fail ( message , e ) ;
152
152
return result ;
153
153
}
154
+ finally
155
+ {
156
+ poolInitSemaphore . Release ( ) ;
157
+ }
154
158
}
155
159
156
160
/// <summary>
@@ -210,6 +214,7 @@ public void Dispose()
210
214
211
215
this . isDisposed = true ;
212
216
this . internalPoolImpl . Dispose ( ) ;
217
+ this . poolInitSemaphore . Dispose ( ) ;
213
218
}
214
219
}
215
220
You can’t perform that action at this time.
0 commit comments