From 90887c29ead481a640151271eedb00345271000b Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 18 Jul 2006 13:12:36 +0000 Subject: [PATCH] Mark timeout task invalid before calling the task callback to avoid busy loop if the scheduler is uninitialized in the callback. --- lib/silcutil/silcschedule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.43.0