Daniel Berger
2006-Oct-26 03:43 UTC
[Win32utils-devel] The win32-service patch is committed - and now, some questions
Hi all, I *finally* committed the patch from Patrick Hurley (you know, the one he submitted way back in June). Looks like it works. I''ve also revamped the code under the examples directory. There''s now a tdaemon.rb (the test daemon) and tdaemon_ctl.rb (the test daemon controller). Before I release this into the wild I want to make sure I document how to use it properly. Based on what I experienced it now looks like users will need to put this snippet in their service_main: # You will see this line in tdaemon.rb while state == RUNNING || state == PAUSED || state == 0 # Do stuff end If I remove the ''|| state == 0'' portion, I still experience deadlock while trying to stop the service. I assume the 0 is the IDLE_CONTROL_CODE value that Patrick added. Is that correct? Also, I wonder if we could abstract that line down to something a little more user friendly. Instead of this stock line: while state == RUNNING || state == PAUSED || state == 0 ... end How about abstracting that down to something like: while running? ... end Just an idea. Regards, Dan
Patrick Hurley
2006-Oct-26 12:36 UTC
[Win32utils-devel] The win32-service patch is committed - and now, some questions
On 10/25/06, Daniel Berger <djberg96 at gmail.com> wrote:> How about abstracting that down to something like: > > while running?I like running? Not sure about the "0" state, as I have not looked at the code for a while. I will take a peek, at the very least we should provide a constant for the magic 0 state. pth
Daniel Berger
2006-Oct-28 00:14 UTC
[Win32utils-devel] The win32-service patch is committed - and now, some questions
On 10/26/06, Patrick Hurley <phurley at gmail.com> wrote:> > On 10/25/06, Daniel Berger <djberg96 at gmail.com> wrote: > > How about abstracting that down to something like: > > > > while running? > > > I like running? Not sure about the "0" state, as I have not looked at > the code for a while. I will take a peek, at the very least we should > provide a constant for the magic 0 state. > > pthHow about SERVICE_IDLE ? Also, do we want to revisit RegisterServiceCtrlHandlerEx()? - Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061027/f5282034/attachment.html