diff options
author | lurchi <lurchi@strangeplace.net> | 2017-09-04 15:05:26 +0200 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2017-09-04 15:05:26 +0200 |
commit | 490c41e78c79a18ab683f83299b041564cb4a69b (patch) | |
tree | 62023b844146738bdb4bc9eea7b0b88a3c890c58 /src/util/scheduler.c | |
parent | 0cdad12df4123d4b30603d552f1e3c1effab5015 (diff) | |
download | gnunet-490c41e78c79a18ab683f83299b041564cb4a69b.tar.gz gnunet-490c41e78c79a18ab683f83299b041564cb4a69b.zip |
Fix select loop running conditions
The select loop has to keep running as long as the driver has tasks
available (indicating that there are file descriptors left to wait for)
or the timeout is not FOREVER (indicating that the scheduler has tasks
with timeout left).
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r-- | src/util/scheduler.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 72f2b7230..4b963209d 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -2209,7 +2209,8 @@ select_loop (void *cls, | |||
2209 | rs = GNUNET_NETWORK_fdset_create (); | 2209 | rs = GNUNET_NETWORK_fdset_create (); |
2210 | ws = GNUNET_NETWORK_fdset_create (); | 2210 | ws = GNUNET_NETWORK_fdset_create (); |
2211 | tasks_ready = GNUNET_NO; | 2211 | tasks_ready = GNUNET_NO; |
2212 | while (NULL != context->scheduled_head || GNUNET_YES == tasks_ready) | 2212 | while (NULL != context->scheduled_head || |
2213 | GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != context->timeout.rel_value_us) | ||
2213 | { | 2214 | { |
2214 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2215 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2215 | "select timeout = %s\n", | 2216 | "select timeout = %s\n", |
@@ -2300,6 +2301,9 @@ select_loop (void *cls, | |||
2300 | } | 2301 | } |
2301 | tasks_ready = GNUNET_SCHEDULER_run_from_driver (sh); | 2302 | tasks_ready = GNUNET_SCHEDULER_run_from_driver (sh); |
2302 | GNUNET_assert (GNUNET_SYSERR != tasks_ready); | 2303 | GNUNET_assert (GNUNET_SYSERR != tasks_ready); |
2304 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
2305 | "select timeout = %s\n", | ||
2306 | GNUNET_STRINGS_relative_time_to_string (context->timeout, GNUNET_NO)); | ||
2303 | } | 2307 | } |
2304 | return GNUNET_OK; | 2308 | return GNUNET_OK; |
2305 | } | 2309 | } |