none
How to suspend and resume the thread RRS feed

  • Question

  • Hi,
    I need to check if there exists a high priority thread then suspend the currently executing thread and perform that high priority thread first and after it finish, resume the suspended one.

    How to do that.
    Saturday, December 19, 2009 11:28 AM

Answers

  • thread1.Suspend();
    thread2.Start();
    while(thread2.IsAlive())/*do nothing*/;
    thread1.Resume();

    With best regards, Yasser Zamani
    • Marked as answer by eryang Friday, December 25, 2009 3:13 AM
    Saturday, December 19, 2009 1:55 PM