diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
commit | 95f9076a2139f5fb042b944a0658b6cda2fa35db (patch) | |
tree | b0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/rps/gnunet-service-rps_sampler.c | |
parent | 7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff) |
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/rps/gnunet-service-rps_sampler.c')
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c index e5f6595bb..2ac6054f4 100644 --- a/src/rps/gnunet-service-rps_sampler.c +++ b/src/rps/gnunet-service-rps_sampler.c @@ -533,12 +533,8 @@ sampler_get_rand_peer (void *cls) struct GetPeerCls *gpc = cls; uint32_t r_index; struct RPS_Sampler *sampler; - const struct GNUNET_SCHEDULER_TaskContext *tc; gpc->get_peer_task = NULL; - tc = GNUNET_SCHEDULER_get_task_context (); - if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) - return; sampler = gpc->req_handle->sampler; /**; @@ -588,12 +584,8 @@ sampler_mod_get_rand_peer (void *cls) struct RPS_SamplerElement *s_elem; struct GNUNET_TIME_Relative last_request_diff; struct RPS_Sampler *sampler; - const struct GNUNET_SCHEDULER_TaskContext *tc; gpc->get_peer_task = NULL; - tc = GNUNET_SCHEDULER_get_task_context (); - if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) - return; sampler = gpc->req_handle->sampler; LOG (GNUNET_ERROR_TYPE_DEBUG, "Single peer was requested\n"); @@ -607,7 +599,8 @@ sampler_mod_get_rand_peer (void *cls) if (EMPTY == s_elem->is_empty) { - LOG (GNUNET_ERROR_TYPE_DEBUG, "Sampler_mod element empty, rescheduling.\n"); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Sampler_mod element empty, rescheduling.\n"); GNUNET_assert (NULL == gpc->get_peer_task); gpc->get_peer_task = GNUNET_SCHEDULER_add_delayed (sampler->max_round_interval, @@ -708,7 +701,8 @@ RPS_sampler_get_n_rand_peers (struct RPS_Sampler *sampler, req_handle->gpc_tail, gpc); // maybe add a little delay - gpc->get_peer_task = GNUNET_SCHEDULER_add_now (sampler->get_peers, gpc); + gpc->get_peer_task = GNUNET_SCHEDULER_add_now (sampler->get_peers, + gpc); } return req_handle; } |