Class: Pool
Instance Method Summary collapse
- #initialize(*args) ⇒ Object constructor
Methods inherited from Fiber
#alive?, #backtrace, #backtrace_locations, #blocking?, blocking?, current, #raise, #resume, schedule, scheduler, set_scheduler, #to_s, #transfer, yield
Constructor Details
#initialize(*args) ⇒ Object
2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 |
# File 'cont.c', line 2809
static VALUE
rb_fiber_pool_initialize(int argc, VALUE* argv, VALUE self)
{
rb_thread_t *th = GET_THREAD();
VALUE size = Qnil, count = Qnil, vm_stack_size = Qnil;
struct fiber_pool * fiber_pool = NULL;
// Maybe these should be keyword arguments.
rb_scan_args(argc, argv, "03", &size, &count, &vm_stack_size);
if (NIL_P(size)) {
size = INT2NUM(th->vm->default_params.fiber_machine_stack_size);
}
if (NIL_P(count)) {
count = INT2NUM(128);
}
if (NIL_P(vm_stack_size)) {
vm_stack_size = INT2NUM(th->vm->default_params.fiber_vm_stack_size);
}
TypedData_Get_Struct(self, struct fiber_pool, &FiberPoolDataType, fiber_pool);
fiber_pool_initialize(fiber_pool, NUM2SIZET(size), NUM2SIZET(count), NUM2SIZET(vm_stack_size));
return self;
}
|