[Win32utils-devel] The win32-service patch is committed - and now, some questions

Daniel Berger djberg96 at gmail.com
Wed Oct 25 23:43:49 EDT 2006


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







More information about the win32utils-devel mailing list