static VALUE t_add_oneshot_timer (VALUE self, VALUE interval) { const unsigned long f = evma_install_oneshot_timer (FIX2INT (interval)); if (!f) rb_raise (rb_eRuntimeError, "%s", "ran out of timers; use #set_max_timers to increase limit"); return ULONG2NUM (f); }
static VALUE t_add_oneshot_timer (VALUE self, VALUE interval) { const unsigned long f = evma_install_oneshot_timer (FIX2INT (interval)); if (!f) rb_raise (rb_eRuntimeError, "no timer"); return ULONG2NUM (f); }
static VALUE t_add_oneshot_timer (VALUE self UNUSED, VALUE interval) { const uintptr_t f = evma_install_oneshot_timer (FIX2INT (interval)); if (!f) rb_raise (rb_eRuntimeError, "%s", "ran out of timers; use #set_max_timers to increase limit"); return BSIG2NUM (f); }
void EM::AddTimer (int milliseconds, void (*func)()) { if (func) { const char *sig = evma_install_oneshot_timer (milliseconds); Timers.insert (make_pair (sig, func)); } }
void EM::AddTimer (int milliseconds, void (*func)()) { if (func) { const char *sig = evma_install_oneshot_timer (milliseconds); #ifdef OS_SOLARIS8 Timers.insert (map<string, void(*)()>::value_type (sig, func)); #else Timers.insert (make_pair (sig, func)); #endif } }