Esempio n. 1
0
static VALUE
pjob_register_one(VALUE self, VALUE obj)
{
    rb_postponed_job_register_one(0, pjob_one_callback, (void *)obj);
    rb_postponed_job_register_one(0, pjob_one_callback, (void *)obj);
    rb_postponed_job_register_one(0, pjob_one_callback, (void *)obj);
    return self;
}
Esempio n. 2
0
static void
stackprof_signal_handler(int sig, siginfo_t *sinfo, void *ucontext)
{
    _stackprof.overall_signals++;
    if (rb_during_gc())
	_stackprof.during_gc++, _stackprof.overall_samples++;
    else
	rb_postponed_job_register_one(0, stackprof_job_handler, 0);
}
Esempio n. 3
0
static void signal_handler(int signal, siginfo_t* sinfo, void* ucontext) {
#ifdef RBKIT_DEV
  double start_wall_time = get_wall_time_in_usec();
  double start_cpu_time = get_cpu_time_in_usec();
#endif
  rb_postponed_job_register_one(0, sampling_job_handler, 0);
#ifdef RBKIT_DEV
  total_wall_time_spent_in_sampling += (get_wall_time_in_usec() - start_wall_time);
  total_cpu_time_spent_in_sampling += (get_cpu_time_in_usec() - start_cpu_time);
#endif
  return;
}