From b7ffc15a0a1adbd6c5515b370fc25e683b254fae Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 2 Oct 2003 14:18:37 +0000 Subject: [PATCH] Removed the fd checks in non-timeout task dispatching. --- lib/silcutil/silcschedule.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c index a474d165..31a5a982 100644 --- a/lib/silcutil/silcschedule.c +++ b/lib/silcutil/silcschedule.c @@ -349,10 +349,9 @@ static void silc_schedule_dispatch_nontimeout(SilcSchedule schedule) if (schedule->fd_list[i].events == 0) continue; - fd = schedule->fd_list[i].fd; - /* First check whether this fd has task in the fd queue */ silc_mutex_lock(schedule->fd_queue->lock); + fd = schedule->fd_list[i].fd; task = silc_task_find(schedule->fd_queue, fd); /* If the task was found then execute its callbacks. If not then @@ -404,8 +403,7 @@ static void silc_schedule_dispatch_nontimeout(SilcSchedule schedule) in the callback function, ie. it is not valid anymore. */ /* Is the task ready for reading */ - if (task->valid && schedule->fd_list[i].revents & SILC_TASK_READ && - fd == schedule->fd_list[i].fd) { + if (task->valid && schedule->fd_list[i].revents & SILC_TASK_READ) { silc_mutex_unlock(schedule->generic_queue->lock); SILC_SCHEDULE_UNLOCK(schedule); task->callback(schedule, schedule->app_context, @@ -415,8 +413,7 @@ static void silc_schedule_dispatch_nontimeout(SilcSchedule schedule) } /* Is the task ready for writing */ - if (task->valid && schedule->fd_list[i].revents & SILC_TASK_WRITE && - fd == schedule->fd_list[i].fd) { + if (task->valid && schedule->fd_list[i].revents & SILC_TASK_WRITE) { silc_mutex_unlock(schedule->generic_queue->lock); SILC_SCHEDULE_UNLOCK(schedule); task->callback(schedule, schedule->app_context, -- 2.43.0