/// <summary> /// Executes the non-parameterized method from within the thread. /// </summary> /// <remarks> /// Once the method returns, the thread is removed from the <see cref="TrackedThreadManager"/> /// and exits. /// </remarks> private void RunThread() { try { this.m_tdsThreadMethod(); } finally { TrackedThreadManager.RemoveThread(this); } }
/// <summary> /// Executes the paramterized method from within the thread. /// </summary> /// <remarks> /// Once the method returns, the thread is removed from the <see cref="TrackedThreadManager"/> /// and exits. /// </remarks> /// <param name="p_objParam">The parameter to pass to the thread.</param> private void RunParameterizedThread(object p_objParam) { try { this.m_ptsThreadMethod(p_objParam); } finally { TrackedThreadManager.RemoveThread(this); } }
/// <summary> /// Initializes the object with the given values. /// </summary> /// <param name="p_tdsThreadMethod">The method to call when the thread starts.</param> public TrackedThread(ThreadStart p_tdsThreadMethod) { m_tdsThreadMethod = p_tdsThreadMethod; m_thdThread = new Thread(RunThread); TrackedThreadManager.AddThread(this); }
/// <summary> /// Initializes the object with the given values. /// </summary> /// <param name="p_ptsThreadMethod">The method to call when the thread starts.</param> public TrackedThread(ParameterizedThreadStart p_ptsThreadMethod) { m_ptsThreadMethod = p_ptsThreadMethod; m_thdThread = new Thread(RunParameterizedThread); TrackedThreadManager.AddThread(this); }