search for: daemon_mainloop_protect

Displaying 2 results from an estimated 2 matches for "daemon_mainloop_protect".

2007 Nov 24
5
Service.start arguments failing or causing segfault
Hi, Unless I''m mistaken the final arguments to Service.start should be passed to the Daemon''s service_main method. Correct? I modified the Service.start method (now in CVS) to look something like this: def self.start(service, host=nil, *args) ... num_args = args.length if args.empty? args = nil else args.unshift(service) # Necessary?
2006 Dec 07
0
Fwd: win32-service problems with patch
...return 1; } return 0; } static VALUE daemon_allocate(VALUE klass){ - EventHookHash = rb_hash_new(); - - thread_group = rb_class_new_instance(0, 0, - rb_const_get(rb_cObject, rb_intern("ThreadGroup"))); return Data_Wrap_Struct(klass, 0, 0, 0); } +static VALUE +daemon_mainloop_protect(VALUE self) +{ + // Call service_main method + if(rb_respond_to(self,rb_intern("service_main"))){ + rb_funcall(self,rb_intern("service_main"),0); + } + + return self; +} + +static VALUE +daemon_mainloop_ensure(VALUE self) +{ + int i; + + // signal both th...