diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
commit | f1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch) | |
tree | 3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/ats-tests/ats-testing-experiment.c | |
parent | 53cd5b8eda2fa8db86b0907a62a39598981d008a (diff) |
making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247
Diffstat (limited to 'src/ats-tests/ats-testing-experiment.c')
-rw-r--r-- | src/ats-tests/ats-testing-experiment.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c index b07d8fdcd6..05c27cbc48 100644 --- a/src/ats-tests/ats-testing-experiment.c +++ b/src/ats-tests/ats-testing-experiment.c @@ -420,13 +420,13 @@ static void timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) { struct Experiment *e = cls; - e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; + e->experiment_timeout_task = NULL; fprintf (stderr, "Experiment timeout!\n"); - if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) + if (NULL != e->episode_timeout_task) { GNUNET_SCHEDULER_cancel (e->episode_timeout_task); - e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; + e->episode_timeout_task = NULL; } e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), @@ -578,7 +578,7 @@ static void timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) { struct Experiment *e = cls; - e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; + e->episode_timeout_task = NULL; if (NULL != e->ep_done_cb) e->ep_done_cb (e->cur); @@ -588,10 +588,10 @@ timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) { /* done */ fprintf (stderr, "Last episode done!\n"); - if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) + if (NULL != e->experiment_timeout_task) { GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); - e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; + e->experiment_timeout_task = NULL; } e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK); return; @@ -728,15 +728,15 @@ GNUNET_ATS_TEST_experimentation_load (char *filename) void GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e) { - if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) + if (NULL != e->experiment_timeout_task) { GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); - e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; + e->experiment_timeout_task = NULL; } - if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) + if (NULL != e->episode_timeout_task) { GNUNET_SCHEDULER_cancel (e->episode_timeout_task); - e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; + e->episode_timeout_task = NULL; } free_experiment (e); } |