All examples now use ManualResetEvent instead of poll for program termination