To check if another thread is waiting on your thread to terminate

  1. In your Execute procedure, implement the Terminate method by checking and responding to the Terminated property.
  2. This is one way to code the logic:

procedure TMyThread.Execute; begin while not Terminated do PerformSomeTask;


WaitFor return values

Value Meaning wrSignaled The signal of the event was set. wrTimeout The specified time elapsed without the signal being set. wrAbandonedThe event object was destroyed before the timeout period elapsed. wrError An error occurred while waiting.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment