Removed the fd checks in non-timeout task dispatching.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 2 Oct 2003 14:18:37 +0000 (14:18 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 2 Oct 2003 14:18:37 +0000 (14:18 +0000)
lib/silcutil/silcschedule.c

index a474d1651ce4c4b2cad15636a62b8b46d4462456..31a5a98286c800fa9915bed4ad55624a4041c955 100644 (file)
@@ -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,