X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcschedule.c;h=6d3f09e1c3d3794f4776ea5211a4115c1492494c;hp=3853a1bb7f3ca808398699daab1248804153f866;hb=196824372226561334cd638d6471267cbffb354c;hpb=b7339a06000ae918f43b1b6064a17d064c6d9b87 diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c index 3853a1bb..6d3f09e1 100644 --- a/lib/silcutil/silcschedule.c +++ b/lib/silcutil/silcschedule.c @@ -476,9 +476,12 @@ static SilcBool silc_schedule_iterate(SilcSchedule schedule, int timeout_usecs) continue; } else { - /* Error */ - if (silc_likely(errno == EINTR)) + /* Error or special case handling */ + if (errno == EINTR) continue; + if (ret == -2) + break; + SILC_LOG_ERROR(("Error in select()/poll(): %s", strerror(errno))); continue; } @@ -501,6 +504,7 @@ SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs) /* Runs the scheduler and blocks here. When this returns the scheduler has ended. */ +#ifndef SILC_SYMBIAN void silc_schedule(SilcSchedule schedule) { SILC_LOG_DEBUG(("Running scheduler")); @@ -510,6 +514,7 @@ void silc_schedule(SilcSchedule schedule) silc_schedule_iterate(schedule, -1); SILC_SCHEDULE_UNLOCK(schedule); } +#endif /* !SILC_SYMBIAN */ /* Wakes up the scheduler. This is used only in multi-threaded environments where threads may add new tasks or remove old tasks @@ -664,6 +669,15 @@ SilcTask silc_schedule_task_add(SilcSchedule schedule, SilcUInt32 fd, out: SILC_SCHEDULE_UNLOCK(schedule); + +#ifdef SILC_SYMBIAN + /* On symbian we wakeup scheduler immediately after adding timeout task + in case the task is added outside the scheduler loop (in some active + object). */ + if (task && task->type == 1) + silc_schedule_wakeup(schedule); +#endif /* SILC_SYMBIAN */ + return task; }