delphi写服务时stop事件不触发

delphi写服务时,ServiceExecute中加上下面的语句,就不会导致stop事件不触发了

while not Terminated do
  begin
    Sleep(10);
    ServiceThread.ProcessRequests(False);//此句

    //其他的需执行的语句
  end;
end;

 
原文地址:https://www.cnblogs.com/wangyuanf/p/2595520.html