File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,9 +24,6 @@ public void Return(Client client)
2424 {
2525 Monitor . Enter ( ClientQueue ) ;
2626 ClientQueue . Enqueue ( client ) ;
27- #if DEBUG
28- Console . WriteLine ( $ "Thread{ Thread . CurrentThread . ManagedThreadId } put back { client } ") ;
29- #endif
3027 Monitor . Pulse ( ClientQueue ) ;
3128 Monitor . Exit ( ClientQueue ) ;
3229 Thread . Sleep ( 0 ) ;
@@ -57,23 +54,13 @@ public Client Take()
5754 Monitor . Enter ( ClientQueue ) ;
5855 if ( ClientQueue . IsEmpty )
5956 {
60- #if DEBUG
61- Console . WriteLine ( $ "Thread{ Thread . CurrentThread . ManagedThreadId } the connection pool is empty, wait timeout:{ Timeout } ") ;
62- #endif
6357 Monitor . Wait ( ClientQueue , TimeSpan . FromSeconds ( Timeout ) ) ;
6458 }
6559 if ( ! ClientQueue . TryDequeue ( out client ) )
6660 {
67- #if DEBUG
68- Console . WriteLine ( $ "Thread{ Thread . CurrentThread . ManagedThreadId } obtaining a client from the client pool failed, wait and try again") ;
69- #endif
7061 }
7162 else
7263 {
73-
74- #if DEBUG
75- Console . WriteLine ( $ "Thread{ Thread . CurrentThread . ManagedThreadId } take away { client } ") ;
76- #endif
7764 }
7865 Monitor . Exit ( ClientQueue ) ;
7966 if ( client == null )
You can’t perform that action at this time.
0 commit comments