コード例 #1
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, "%s", "ran out of timers; use #set_max_timers to increase limit");
    return ULONG2NUM (f);
}
コード例 #2
0
ファイル: rubymain.cpp プロジェクト: bernd/eventmachine
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
ファイル: cplusplus.cpp プロジェクト: alltom/easyget
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
	}
}