- Remove a non-recurring job from the job list after starting it.
- Remove a recurring job from the start list, calculate its next start time and insert it again.
- Calculate the timeout for the next job.
Use WaitForMultipleObjects in the mail scheduler loop:
- Use events to signal service stop and job update events to the main loop.
- Use the timeout timer to start the next job.