diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/testbed/gnunet-service-testbed_cpustatus.c | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip |
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/testbed/gnunet-service-testbed_cpustatus.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_cpustatus.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c index 066c680b3..cda669caa 100644 --- a/src/testbed/gnunet-service-testbed_cpustatus.c +++ b/src/testbed/gnunet-service-testbed_cpustatus.c | |||
@@ -646,7 +646,7 @@ get_nproc () | |||
646 | 646 | ||
647 | 647 | ||
648 | static void | 648 | static void |
649 | sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 649 | sample_load_task (void *cls) |
650 | { | 650 | { |
651 | struct GNUNET_TIME_Absolute now; | 651 | struct GNUNET_TIME_Absolute now; |
652 | char *str; | 652 | char *str; |
@@ -655,8 +655,10 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
655 | int ld_disk; | 655 | int ld_disk; |
656 | unsigned int mem_usage; | 656 | unsigned int mem_usage; |
657 | unsigned int nproc; | 657 | unsigned int nproc; |
658 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
658 | 659 | ||
659 | sample_load_task_id = NULL; | 660 | sample_load_task_id = NULL; |
661 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
660 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 662 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
661 | return; | 663 | return; |
662 | ld_cpu = cpu_get_load (); | 664 | ld_cpu = cpu_get_load (); |