guix-env: some update.
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed_cpustatus.c
index 4071c717259f461164e5ad0a2fe1c8350714712a..ae49e31f9ecea6344575139c153e6839612ff704 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2008--2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2008--2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -54,6 +54,9 @@
 
 static processor_cpu_load_info_t prev_cpu_load;
 #endif
+#ifdef WINDOWS
+#include <winternl.h>
+#endif
 
 #define DEBUG_STATUSCALLS GNUNET_NO
 
@@ -82,7 +85,7 @@ static double agedIOLoad = -1;
  */
 struct GNUNET_BIO_WriteHandle *bw;
 
-GNUNET_SCHEDULER_TaskIdentifier sample_load_task_id;
+struct GNUNET_SCHEDULER_Task * sample_load_task_id;
 
 
 #ifdef OSX
@@ -643,7 +646,7 @@ get_nproc ()
 
 
 static void
-sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sample_load_task (void *cls)
 {
   struct GNUNET_TIME_Absolute now;
   char *str;
@@ -653,9 +656,7 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   unsigned int mem_usage;
   unsigned int nproc;
 
-  sample_load_task_id = GNUNET_SCHEDULER_NO_TASK;
-  if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
-    return;
+  sample_load_task_id = NULL;
   ld_cpu = cpu_get_load ();
   ld_disk = disk_get_load ();
   if ( (-1 == ld_cpu) || (-1 == ld_disk) )
@@ -764,10 +765,10 @@ GST_stats_destroy ()
 #elif OSX
   GNUNET_free_non_null (prev_cpu_load);
 #endif
-  if (GNUNET_SCHEDULER_NO_TASK != sample_load_task_id)
+  if (NULL != sample_load_task_id)
   {
     GNUNET_SCHEDULER_cancel (sample_load_task_id);
-    sample_load_task_id = GNUNET_SCHEDULER_NO_TASK;
+    sample_load_task_id = NULL;
   }
   GNUNET_break (GNUNET_OK == GNUNET_BIO_write_close (bw));
   bw = NULL;