Michael Fischer found and Edgar Grimberg fixed generic crash in timers reproduceable with at91fr40008

git-svn-id: svn://svn.berlios.de/openocd/trunk@663 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2008-05-19 08:44:57 +00:00
parent e2ebed86bf
commit 552244724c
1 changed files with 14 additions and 11 deletions

View File

@ -747,6 +747,8 @@ static int target_call_timer_callbacks_check_time(int checktime)
if ((!checktime&&callback->periodic)|| if ((!checktime&&callback->periodic)||
(((now.tv_sec >= callback->when.tv_sec) && (now.tv_usec >= callback->when.tv_usec)) (((now.tv_sec >= callback->when.tv_sec) && (now.tv_usec >= callback->when.tv_usec))
|| (now.tv_sec > callback->when.tv_sec))) || (now.tv_sec > callback->when.tv_sec)))
{
if(callback->callback != NULL)
{ {
callback->callback(callback->priv); callback->callback(callback->priv);
if (callback->periodic) if (callback->periodic)
@ -764,6 +766,7 @@ static int target_call_timer_callbacks_check_time(int checktime)
else else
target_unregister_timer_callback(callback->callback, callback->priv); target_unregister_timer_callback(callback->callback, callback->priv);
} }
}
callback = next_callback; callback = next_callback;
} }