File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -565,22 +565,25 @@ private static void ClearQueue(ConnectorQueue Queue)
565565 return ;
566566 }
567567
568- while ( Queue . Available . Count > 0 )
568+ lock ( Queue )
569569 {
570- NpgsqlConnector connector = Queue . Available . Dequeue ( ) ;
571-
572- try
573- {
574- connector . Close ( ) ;
575- }
576- catch
570+ while ( Queue . Available . Count > 0 )
577571 {
578- // Maybe we should log something here to say we got an exception while closing connector?
572+ NpgsqlConnector connector = Queue . Available . Dequeue ( ) ;
573+
574+ try
575+ {
576+ connector . Close ( ) ;
577+ }
578+ catch
579+ {
580+ // Maybe we should log something here to say we got an exception while closing connector?
581+ }
579582 }
580- }
581583
582- //Clear the busy list so that the current connections don't get re-added to the queue
583- Queue . Busy . Clear ( ) ;
584+ //Clear the busy list so that the current connections don't get re-added to the queue
585+ Queue . Busy . Clear ( ) ;
586+ }
584587 }
585588
586589 internal void ClearPool ( NpgsqlConnection Connection )
You can’t perform that action at this time.
0 commit comments