X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcschedule.c;h=169f4535d275646112b0ab364dfb0b32e4da2aa0;hp=5ea2ebf00a743da144358d6fd9c506face1902c2;hb=d1e71f42379e8b5cd0748a7aeae8561b02cfe53d;hpb=34bb35a2496ec0402bb4d6c2546147cd37b27007 diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c index 5ea2ebf0..169f4535 100644 --- a/lib/silcutil/silcschedule.c +++ b/lib/silcutil/silcschedule.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1998 - 2003 Pekka Riikonen + Copyright (C) 1998 - 2005 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 @@ -607,6 +607,16 @@ bool silc_schedule_one(SilcSchedule schedule, int timeout_usecs) return FALSE; } + /* If the task queues aren't initialized or we aren't valid anymore + we will return */ + if ((!schedule->fd_queue && !schedule->timeout_queue + && !schedule->generic_queue) || schedule->valid == FALSE) { + SILC_LOG_DEBUG(("Scheduler not valid anymore, exiting")); + if (!schedule->is_locked) + SILC_SCHEDULE_UNLOCK(schedule); + return FALSE; + } + /* Calculate next timeout for silc_select(). This is the timeout value when at earliest some of the timeout tasks expire. */ silc_mutex_lock(schedule->timeout_queue->lock);