aboutsummaryrefslogtreecommitdiff
path: root/src/sensor/sensor_util_lib.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
commitf1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch)
tree3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/sensor/sensor_util_lib.c
parent53cd5b8eda2fa8db86b0907a62a39598981d008a (diff)
downloadgnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.tar.gz
gnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.zip
making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247
Diffstat (limited to 'src/sensor/sensor_util_lib.c')
-rw-r--r--src/sensor/sensor_util_lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sensor/sensor_util_lib.c b/src/sensor/sensor_util_lib.c
index fd5337343..381465d22 100644
--- a/src/sensor/sensor_util_lib.c
+++ b/src/sensor/sensor_util_lib.c
@@ -274,7 +274,7 @@ load_sensor_from_cfg (struct GNUNET_CONFIGURATION_Handle *cfg,
274 GNUNET_free (dummy); 274 GNUNET_free (dummy);
275 } 275 }
276 //execution task 276 //execution task
277 sensor->execution_task = GNUNET_SCHEDULER_NO_TASK; 277 sensor->execution_task = NULL;
278 //running 278 //running
279 sensor->running = GNUNET_NO; 279 sensor->running = GNUNET_NO;
280 return sensor; 280 return sensor;
@@ -479,10 +479,10 @@ destroy_sensor (void *cls, const struct GNUNET_HashCode *key, void *value)
479{ 479{
480 struct GNUNET_SENSOR_SensorInfo *sensor = value; 480 struct GNUNET_SENSOR_SensorInfo *sensor = value;
481 481
482 if (GNUNET_SCHEDULER_NO_TASK != sensor->execution_task) 482 if (NULL != sensor->execution_task)
483 { 483 {
484 GNUNET_SCHEDULER_cancel (sensor->execution_task); 484 GNUNET_SCHEDULER_cancel (sensor->execution_task);
485 sensor->execution_task = GNUNET_SCHEDULER_NO_TASK; 485 sensor->execution_task = NULL;
486 } 486 }
487 if (NULL != sensor->gnunet_stat_get_handle) 487 if (NULL != sensor->gnunet_stat_get_handle)
488 { 488 {