Displaying 2 results from an estimated 2 matches for "rb_thread_pol".
2006 Jun 19
9
win32-service patch
...ttached is a patch and my service.c if there is any difficulty
applying the patch. I did the following:
1. Created a ruby thread (Ruby_Service_Ctrl), that polls against a
simple integer value (protected by a critical section). I was worried
this would be "expensive"; however, I found the rb_thread_polling
method and it seems to work well.
2. When an event occurs in Service_Ctrl it sets the flag value.
3. If Ruby_Service_Ctrl finds an entry in the call back hash it
invokes it (in its own thread) and goes back to polling
4. On a SERVICE_CONTROL_STOP the Ruby_Service_Ctrl, processes normally
and...
2006 Dec 07
0
Fwd: win32-service problems with patch
...if (waiting_control_code == SERVICE_CONTROL_STOP)
+ else {
break;
-
+ }
waiting_control_code = IDLE_CONTROL_CODE;
}
}
@@ -131,20 +127,19 @@
}
// This is an ugly polling loop, be as polite as possible
- rb_thread_polling();
- }
-
- for (;;)
- {
- VALUE list = rb_funcall(thread_group, cList, 0);
- VALUE size = rb_funcall(list, cSize, 0);
- if (NUM2INT(size) == 0)
- break;
-
- // This is another ugly polling loop, be as polite as possible
rb_thread_polling();
}
-...