* Removed unwanted ManualResetEvent from ServiceController
Fixes https://github.com/dotnet/runtime/issues/44699
* Addressed PR feedback.
Added delay of 250 ms.
public class ServiceController : Component
{
private string _machineName; // Never null
- private readonly ManualResetEvent _waitForStatusSignal = new ManualResetEvent(false);
private const string DefaultMachineName = ".";
private string? _name;
if (DateTime.UtcNow - start > timeout)
throw new System.ServiceProcess.TimeoutException(SR.Format(SR.Timeout, ServiceName));
- _waitForStatusSignal.WaitOne(250);
+ Thread.Sleep(250);
Refresh();
}
}