Added jmanager_timer_is_running() function to know if a timer is running.

This commit is contained in:
David Capello 2010-04-10 15:54:46 -03:00
parent bd6bff7998
commit c4e57b2777
2 changed files with 9 additions and 0 deletions

View File

@ -662,6 +662,14 @@ void jmanager_set_timer_interval(int timer_id, int interval)
timers[timer_id]->interval = interval;
}
bool jmanager_timer_is_running(int timer_id)
{
assert(timer_id >= 0 && timer_id < n_timers);
assert(timers[timer_id] != NULL);
return (timers[timer_id]->last_time >= 0);
}
/**
* @param msg You can't use the this message after calling this
* routine. The message will be automatically freed through

View File

@ -50,6 +50,7 @@ void jmanager_remove_timer(int timer_id);
void jmanager_start_timer(int timer_id);
void jmanager_stop_timer(int timer_id);
void jmanager_set_timer_interval(int timer_id, int interval);
bool jmanager_timer_is_running(int timer_id);
/* routines that uses the ji_get_default_manager() */