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);
}
예제 #2
0
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);
}
예제 #3
0
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);
}
예제 #4
0
void EM::AddTimer (int milliseconds, void (*func)())
{
	if (func) {
		const char *sig = evma_install_oneshot_timer (milliseconds);
		Timers.insert (make_pair (sig, func));
	}
}
예제 #5
0
파일: cplusplus.cpp 프로젝트: STRd6/strd6
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
	}
}