Exemplo n.º 1
0
static int
luaH_timer_stop(lua_State *L)
{
    ltimer_t *timer = luaH_checktimer(L, 1);
    if (timer->id == TIMER_STOPPED)
        luaH_warn(L, "timer already stopped");
    else
        luaH_timer_destroy(L, timer);
    return 0;
}
Exemplo n.º 2
0
static int
luaH_timer_stop(lua_State *L)
{
    ltimer_t *timer = luaH_checkudata(L, 1, &timer_class);
    if (timer->timer_id == TIMER_STOPPED) {
        luaH_warn(L, "timer already stopped. Cannot stop a timer twice");
    } else {
        luaH_timer_destroy(L, timer);
    }
    return 0;
}