aboutsummaryrefslogtreecommitdiff
path: root/src/dv
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
commit29e6158507a0758192075ac6ece7ba8e75ddc49a (patch)
treeb91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/dv
parent5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff)
downloadgnunet-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/dv')
-rw-r--r--src/dv/gnunet-dv.c4
-rw-r--r--src/dv/gnunet-service-dv.c16
-rw-r--r--src/dv/test_transport_dv.c3
3 files changed, 6 insertions, 17 deletions
diff --git a/src/dv/gnunet-dv.c b/src/dv/gnunet-dv.c
index 42234ad21..d5d95acca 100644
--- a/src/dv/gnunet-dv.c
+++ b/src/dv/gnunet-dv.c
@@ -119,11 +119,9 @@ message_cb (void *cls,
119 * Task run on shutdown. 119 * Task run on shutdown.
120 * 120 *
121 * @param cls NULL 121 * @param cls NULL
122 * @param tc unused
123 */ 122 */
124static void 123static void
125shutdown_task (void *cls, 124shutdown_task (void *cls)
126 const struct GNUNET_SCHEDULER_TaskContext *tc)
127{ 125{
128 GNUNET_DV_service_disconnect (sh); 126 GNUNET_DV_service_disconnect (sh);
129 sh = NULL; 127 sh = NULL;
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 2ddd99197..bd0057ab4 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -398,11 +398,9 @@ static int in_shutdown;
398 * 398 *
399 * @param cls the 'struct DirectNeighbor' of the peer we're building 399 * @param cls the 'struct DirectNeighbor' of the peer we're building
400 * a routing consensus with 400 * a routing consensus with
401 * @param tc scheduler context
402 */ 401 */
403static void 402static void
404initiate_set_union (void *cls, 403initiate_set_union (void *cls);
405 const struct GNUNET_SCHEDULER_TaskContext *tc);
406 404
407 405
408/** 406/**
@@ -1132,11 +1130,9 @@ refresh_routes (void *cls,
1132 * Task to run #refresh_routes() on all direct neighbours. 1130 * Task to run #refresh_routes() on all direct neighbours.
1133 * 1131 *
1134 * @param cls NULL 1132 * @param cls NULL
1135 * @param tc unused
1136 */ 1133 */
1137static void 1134static void
1138refresh_routes_task (void *cls, 1135refresh_routes_task (void *cls)
1139 const struct GNUNET_SCHEDULER_TaskContext *tc)
1140{ 1136{
1141 rr_task = NULL; 1137 rr_task = NULL;
1142 GNUNET_CONTAINER_multipeermap_iterate (direct_neighbors, 1138 GNUNET_CONTAINER_multipeermap_iterate (direct_neighbors,
@@ -1692,11 +1688,9 @@ listen_set_union (void *cls,
1692 * 1688 *
1693 * @param cls the `struct DirectNeighbor *` of the peer we're building 1689 * @param cls the `struct DirectNeighbor *` of the peer we're building
1694 * a routing consensus with 1690 * a routing consensus with
1695 * @param tc scheduler context
1696 */ 1691 */
1697static void 1692static void
1698initiate_set_union (void *cls, 1693initiate_set_union (void *cls)
1699 const struct GNUNET_SCHEDULER_TaskContext *tc)
1700{ 1694{
1701 struct DirectNeighbor *neighbor = cls; 1695 struct DirectNeighbor *neighbor = cls;
1702 1696
@@ -2082,11 +2076,9 @@ free_direct_neighbors (void *cls,
2082 * Task run during shutdown. 2076 * Task run during shutdown.
2083 * 2077 *
2084 * @param cls unused 2078 * @param cls unused
2085 * @param tc unused
2086 */ 2079 */
2087static void 2080static void
2088shutdown_task (void *cls, 2081shutdown_task (void *cls)
2089 const struct GNUNET_SCHEDULER_TaskContext *tc)
2090{ 2082{
2091 unsigned int i; 2083 unsigned int i;
2092 2084
diff --git a/src/dv/test_transport_dv.c b/src/dv/test_transport_dv.c
index 245914f07..1afa30fa9 100644
--- a/src/dv/test_transport_dv.c
+++ b/src/dv/test_transport_dv.c
@@ -36,8 +36,7 @@ static struct GNUNET_SCHEDULER_Task * shutdown_task;
36 36
37 37
38static void 38static void
39do_shutdown (void *cls, 39do_shutdown (void *cls)
40 const struct GNUNET_SCHEDULER_TaskContext *tc)
41{ 40{
42 shutdown_task = NULL; 41 shutdown_task = NULL;
43 if (NULL != topology_op) 42 if (NULL != topology_op)