diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-04-01 16:06:17 +0200 |
---|---|---|
committer | t3serakt <t3ss@posteo.de> | 2024-04-10 20:14:58 +0200 |
commit | f1984d0edd24851b58e102e1a9b74b8e216a86ac (patch) | |
tree | 3f6de8f7ce79722a618f607f998a1cb9b56d4fef | |
parent | 06ce0fc9ccefe78e344889f96767fe098472e0cb (diff) | |
download | gnunet-f1984d0edd24851b58e102e1a9b74b8e216a86ac.tar.gz gnunet-f1984d0edd24851b58e102e1a9b74b8e216a86ac.zip |
better error reporting on scheduler issues
m--------- | contrib/gana | 0 | ||||
-rw-r--r-- | src/lib/util/gnunet_error_codes.c | 1 | ||||
-rw-r--r-- | src/lib/util/scheduler.c | 26 |
3 files changed, 16 insertions, 11 deletions
diff --git a/contrib/gana b/contrib/gana | |||
Subproject 53d0992890e1ebb8f8c6bd747533abe157baec6 | Subproject d505fecdf8f1339f4115f10f1ae236da7cfea0e | ||
diff --git a/src/lib/util/gnunet_error_codes.c b/src/lib/util/gnunet_error_codes.c index c286f2e52..11ce2d0c8 100644 --- a/src/lib/util/gnunet_error_codes.c +++ b/src/lib/util/gnunet_error_codes.c | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | #include "platform.h" | ||
21 | #include "gnunet_error_codes.h" | 20 | #include "gnunet_error_codes.h" |
22 | #include <stddef.h> | 21 | #include <stddef.h> |
23 | #include <microhttpd.h> | 22 | #include <microhttpd.h> |
diff --git a/src/lib/util/scheduler.c b/src/lib/util/scheduler.c index 70193a0d2..1dce928b4 100644 --- a/src/lib/util/scheduler.c +++ b/src/lib/util/scheduler.c | |||
@@ -510,7 +510,9 @@ get_timeout () | |||
510 | return timeout; | 510 | return timeout; |
511 | } | 511 | } |
512 | 512 | ||
513 | static void remove_pass_end_marker () | 513 | |
514 | static void | ||
515 | remove_pass_end_marker () | ||
514 | { | 516 | { |
515 | if (pass_end_marker.in_ready_list) | 517 | if (pass_end_marker.in_ready_list) |
516 | { | 518 | { |
@@ -521,7 +523,9 @@ static void remove_pass_end_marker () | |||
521 | } | 523 | } |
522 | } | 524 | } |
523 | 525 | ||
524 | static void set_work_priority (enum GNUNET_SCHEDULER_Priority p) | 526 | |
527 | static void | ||
528 | set_work_priority (enum GNUNET_SCHEDULER_Priority p) | ||
525 | { | 529 | { |
526 | remove_pass_end_marker (); | 530 | remove_pass_end_marker (); |
527 | GNUNET_CONTAINER_DLL_insert_tail (ready_head[p], | 531 | GNUNET_CONTAINER_DLL_insert_tail (ready_head[p], |
@@ -532,6 +536,7 @@ static void set_work_priority (enum GNUNET_SCHEDULER_Priority p) | |||
532 | work_priority = p; | 536 | work_priority = p; |
533 | } | 537 | } |
534 | 538 | ||
539 | |||
535 | /** | 540 | /** |
536 | * Put a task that is ready for execution into the ready queue. | 541 | * Put a task that is ready for execution into the ready queue. |
537 | * | 542 | * |
@@ -711,7 +716,7 @@ shutdown_if_no_lifeness (void) | |||
711 | } | 716 | } |
712 | 717 | ||
713 | 718 | ||
714 | static int | 719 | static enum GNUNET_GenericReturnValue |
715 | select_loop (struct GNUNET_SCHEDULER_Handle *sh, | 720 | select_loop (struct GNUNET_SCHEDULER_Handle *sh, |
716 | struct DriverContext *context); | 721 | struct DriverContext *context); |
717 | 722 | ||
@@ -735,8 +740,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task, | |||
735 | task_cls, | 740 | task_cls, |
736 | GNUNET_SCHEDULER_REASON_STARTUP, | 741 | GNUNET_SCHEDULER_REASON_STARTUP, |
737 | GNUNET_SCHEDULER_PRIORITY_DEFAULT); | 742 | GNUNET_SCHEDULER_PRIORITY_DEFAULT); |
738 | select_loop (sh, | 743 | GNUNET_break (GNUNET_OK == |
739 | &context); | 744 | select_loop (sh, |
745 | &context)); | ||
740 | GNUNET_SCHEDULER_driver_done (sh); | 746 | GNUNET_SCHEDULER_driver_done (sh); |
741 | GNUNET_free (driver); | 747 | GNUNET_free (driver); |
742 | } | 748 | } |
@@ -2276,12 +2282,12 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver) | |||
2276 | void | 2282 | void |
2277 | GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh) | 2283 | GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh) |
2278 | { | 2284 | { |
2279 | GNUNET_assert (NULL == pending_head); | 2285 | GNUNET_break (NULL == pending_head); |
2280 | GNUNET_assert (NULL == pending_timeout_head); | 2286 | GNUNET_break (NULL == pending_timeout_head); |
2281 | GNUNET_assert (NULL == shutdown_head); | 2287 | GNUNET_break (NULL == shutdown_head); |
2282 | for (int i = 0; i != GNUNET_SCHEDULER_PRIORITY_COUNT; ++i) | 2288 | for (int i = 0; i != GNUNET_SCHEDULER_PRIORITY_COUNT; ++i) |
2283 | { | 2289 | { |
2284 | GNUNET_assert (NULL == ready_head[i]); | 2290 | GNUNET_break (NULL == ready_head[i]); |
2285 | } | 2291 | } |
2286 | GNUNET_NETWORK_fdset_destroy (sh->rs); | 2292 | GNUNET_NETWORK_fdset_destroy (sh->rs); |
2287 | GNUNET_NETWORK_fdset_destroy (sh->ws); | 2293 | GNUNET_NETWORK_fdset_destroy (sh->ws); |
@@ -2302,7 +2308,7 @@ GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh) | |||
2302 | } | 2308 | } |
2303 | 2309 | ||
2304 | 2310 | ||
2305 | static int | 2311 | static enum GNUNET_GenericReturnValue |
2306 | select_loop (struct GNUNET_SCHEDULER_Handle *sh, | 2312 | select_loop (struct GNUNET_SCHEDULER_Handle *sh, |
2307 | struct DriverContext *context) | 2313 | struct DriverContext *context) |
2308 | { | 2314 | { |