Pool of Objects - Synchronize - Delphi
问题 I am implementing a pool of objects in Delphi. I need to synchronize the threads to get the objects from the pool. Thread Code: uClientQueryPool.CLIENT_POOL_GUARD.Acquire(); QueryClient := QUERY_POOL.GetClient(); uClientQueryPool.CLIENT_POOL_GUARD.Release; Pool Code: var CLIENT_POOL_GUARD: TCriticalSection; type TClientQueryPool = class public function GetClient(): TQueryClient; end; The CLIENT_POOL_GUARD is a unit variable. The pool is working well, but can I use "uClientQueryPool.CLIENT