From: Pekka Riikonen Date: Tue, 18 Jul 2006 13:12:36 +0000 (+0000) Subject: Mark timeout task invalid before calling the task callback to X-Git-Tag: silc.client.1.1.beta1~296 X-Git-Url: http://git.silc.fi/gitweb/?a=commitdiff_plain;h=90887c29ead481a640151271eedb00345271000b;p=silc.git Mark timeout task invalid before calling the task callback to avoid busy loop if the scheduler is uninitialized in the callback. --- diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c index 8c5cfd66..d60b6d30 100644 --- a/lib/silcutil/silcschedule.c +++ b/lib/silcutil/silcschedule.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1998 - 2005 Pekka Riikonen + Copyright (C) 1998 - 2006 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -196,6 +196,7 @@ static void silc_schedule_dispatch_timeout(SilcSchedule schedule, /* Execute the task if the timeout has expired */ if (dispatch_all || silc_compare_timeval(&task->timeout, &curtime)) { + t->valid = FALSE; SILC_SCHEDULE_UNLOCK(schedule); t->callback(schedule, schedule->app_context, SILC_TASK_EXPIRE, 0, t->context);