Reclaim() private méthode

private Reclaim ( TaskContext ctx ) : void
ctx TaskContext
Résultat void
Exemple #1
0
        /// <summary>
        /// Wait will wait for the given task to complete, and then dispose
        /// the context. After Wait() returns, you should do nothing else to
        /// the context.
        /// </summary>
        public void Wait()
        {
            if (Worker == null)
            {
                throw new ObjectDisposedException("TaskContext.Wait()");
            }

            Worker = null;
            Event.WaitOne();
            ThreadPoolComponent.Reclaim(this);
        }
Exemple #2
0
        public void Dispose()
        {
            if (Worker == null)
            {
                throw new ObjectDisposedException("TaskContext.Dispose()");
            }

            Worker.Context = null;
            Worker         = null;
            ThreadPoolComponent.Reclaim(this);
        }