diff options
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r-- | src/util/scheduler.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index a38bebf84..8652ee297 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -383,7 +383,7 @@ is_ready (struct Task *task, struct GNUNET_TIME_Absolute now, | |||
383 | reason |= GNUNET_SCHEDULER_REASON_WRITE_READY; | 383 | reason |= GNUNET_SCHEDULER_REASON_WRITE_READY; |
384 | if (reason == 0) | 384 | if (reason == 0) |
385 | return GNUNET_NO; /* not ready */ | 385 | return GNUNET_NO; /* not ready */ |
386 | reason |= GNUNET_SCHEDULER_REASON_PREREQ_DONE; | 386 | reason |= GNUNET_SCHEDULER_REASON_PREREQ_DONE; |
387 | task->reason = reason; | 387 | task->reason = reason; |
388 | return GNUNET_YES; | 388 | return GNUNET_YES; |
389 | } | 389 | } |
@@ -442,7 +442,7 @@ check_ready (const struct GNUNET_NETWORK_FDSet *rs, | |||
442 | pos = pending; | 442 | pos = pending; |
443 | while (pos != NULL) | 443 | while (pos != NULL) |
444 | { | 444 | { |
445 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 445 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
446 | "Checking readiness of task: %llu / %p\n", | 446 | "Checking readiness of task: %llu / %p\n", |
447 | pos->id, pos->callback_cls); | 447 | pos->id, pos->callback_cls); |
448 | next = pos->next; | 448 | next = pos->next; |
@@ -568,7 +568,7 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs, struct GNUNET_NETWORK_FDSet *ws) | |||
568 | if (GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value_us > | 568 | if (GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value_us > |
569 | DELAY_THRESHOLD.rel_value_us) | 569 | DELAY_THRESHOLD.rel_value_us) |
570 | { | 570 | { |
571 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 571 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
572 | "Task %llu took %s to be scheduled\n", | 572 | "Task %llu took %s to be scheduled\n", |
573 | (unsigned long long) pos->id, | 573 | (unsigned long long) pos->id, |
574 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (pos->start_time), GNUNET_YES)); | 574 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (pos->start_time), GNUNET_YES)); |
@@ -587,7 +587,7 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs, struct GNUNET_NETWORK_FDSet *ws) | |||
587 | (pos->write_fd != -1) && | 587 | (pos->write_fd != -1) && |
588 | (!GNUNET_NETWORK_fdset_test_native (ws, pos->write_fd))) | 588 | (!GNUNET_NETWORK_fdset_test_native (ws, pos->write_fd))) |
589 | GNUNET_abort (); // added to ready in previous select loop! | 589 | GNUNET_abort (); // added to ready in previous select loop! |
590 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 590 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
591 | "Running task: %llu / %p\n", pos->id, | 591 | "Running task: %llu / %p\n", pos->id, |
592 | pos->callback_cls); | 592 | pos->callback_cls); |
593 | pos->callback (pos->callback_cls, &tc); | 593 | pos->callback (pos->callback_cls, &tc); |
@@ -1052,7 +1052,7 @@ GNUNET_SCHEDULER_TaskIdentifier | |||
1052 | GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, | 1052 | GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, |
1053 | GNUNET_SCHEDULER_Task task, void *task_cls) | 1053 | GNUNET_SCHEDULER_Task task, void *task_cls) |
1054 | { | 1054 | { |
1055 | return GNUNET_SCHEDULER_add_select (prio, | 1055 | return GNUNET_SCHEDULER_add_select (prio, |
1056 | GNUNET_TIME_UNIT_ZERO, NULL, NULL, task, | 1056 | GNUNET_TIME_UNIT_ZERO, NULL, NULL, task, |
1057 | task_cls); | 1057 | task_cls); |
1058 | } | 1058 | } |
@@ -1175,7 +1175,7 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, | |||
1175 | * to run) might get to run first. Just as with delays, clients must | 1175 | * to run) might get to run first. Just as with delays, clients must |
1176 | * not rely on any particular order of execution between tasks | 1176 | * not rely on any particular order of execution between tasks |
1177 | * scheduled concurrently. | 1177 | * scheduled concurrently. |
1178 | * | 1178 | * |
1179 | * The task will be run with the DEFAULT priority. | 1179 | * The task will be run with the DEFAULT priority. |
1180 | * | 1180 | * |
1181 | * @param task main function of the task | 1181 | * @param task main function of the task |
@@ -1250,7 +1250,7 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, | |||
1250 | */ | 1250 | */ |
1251 | #ifndef MINGW | 1251 | #ifndef MINGW |
1252 | static GNUNET_SCHEDULER_TaskIdentifier | 1252 | static GNUNET_SCHEDULER_TaskIdentifier |
1253 | add_without_sets (struct GNUNET_TIME_Relative delay, | 1253 | add_without_sets (struct GNUNET_TIME_Relative delay, |
1254 | enum GNUNET_SCHEDULER_Priority priority, | 1254 | enum GNUNET_SCHEDULER_Priority priority, |
1255 | int rfd, int wfd, | 1255 | int rfd, int wfd, |
1256 | GNUNET_SCHEDULER_Task task, void *task_cls) | 1256 | GNUNET_SCHEDULER_Task task, void *task_cls) |
@@ -1396,7 +1396,7 @@ GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, | |||
1396 | GNUNET_NETWORK_fdset_destroy (rs); | 1396 | GNUNET_NETWORK_fdset_destroy (rs); |
1397 | return ret; | 1397 | return ret; |
1398 | #else | 1398 | #else |
1399 | return add_without_sets (delay, | 1399 | return add_without_sets (delay, |
1400 | priority, | 1400 | priority, |
1401 | GNUNET_NETWORK_get_fd (rfd), -1, task, | 1401 | GNUNET_NETWORK_get_fd (rfd), -1, task, |
1402 | task_cls); | 1402 | task_cls); |
@@ -1441,7 +1441,7 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | |||
1441 | return ret; | 1441 | return ret; |
1442 | #else | 1442 | #else |
1443 | GNUNET_assert (GNUNET_NETWORK_get_fd (wfd) >= 0); | 1443 | GNUNET_assert (GNUNET_NETWORK_get_fd (wfd) >= 0); |
1444 | return add_without_sets (delay, | 1444 | return add_without_sets (delay, |
1445 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 1445 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
1446 | -1, GNUNET_NETWORK_get_fd (wfd), task, | 1446 | -1, GNUNET_NETWORK_get_fd (wfd), task, |
1447 | task_cls); | 1447 | task_cls); |
@@ -1486,7 +1486,7 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, | |||
1486 | int fd; | 1486 | int fd; |
1487 | 1487 | ||
1488 | GNUNET_DISK_internal_file_handle_ (rfd, &fd, sizeof (int)); | 1488 | GNUNET_DISK_internal_file_handle_ (rfd, &fd, sizeof (int)); |
1489 | return add_without_sets (delay, | 1489 | return add_without_sets (delay, |
1490 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 1490 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
1491 | fd, -1, task, task_cls); | 1491 | fd, -1, task, task_cls); |
1492 | 1492 | ||
@@ -1532,7 +1532,7 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, | |||
1532 | 1532 | ||
1533 | GNUNET_DISK_internal_file_handle_ (wfd, &fd, sizeof (int)); | 1533 | GNUNET_DISK_internal_file_handle_ (wfd, &fd, sizeof (int)); |
1534 | GNUNET_assert (fd >= 0); | 1534 | GNUNET_assert (fd >= 0); |
1535 | return add_without_sets (delay, | 1535 | return add_without_sets (delay, |
1536 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 1536 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
1537 | -1, fd, task, task_cls); | 1537 | -1, fd, task, task_cls); |
1538 | 1538 | ||