aboutsummaryrefslogtreecommitdiff
path: root/src/ats
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/ats
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/ats')
-rw-r--r--src/ats/ats_api_connectivity.c4
-rw-r--r--src/ats/ats_api_performance.c4
-rw-r--r--src/ats/ats_api_scanner.c4
-rw-r--r--src/ats/ats_api_scheduling.c4
-rw-r--r--src/ats/gnunet-ats-solver-eval.c19
-rw-r--r--src/ats/gnunet-service-ats.c4
-rw-r--r--src/ats/gnunet-service-ats_preferences.c4
-rw-r--r--src/ats/plugin_ats_ril.c3
-rw-r--r--src/ats/test_ats_lib.c12
9 files changed, 21 insertions, 37 deletions
diff --git a/src/ats/ats_api_connectivity.c b/src/ats/ats_api_connectivity.c
index f1898af3f..1897e2783 100644
--- a/src/ats/ats_api_connectivity.c
+++ b/src/ats/ats_api_connectivity.c
@@ -106,11 +106,9 @@ reconnect (struct GNUNET_ATS_ConnectivityHandle *ch);
106 * Re-establish the connection to the ATS service. 106 * Re-establish the connection to the ATS service.
107 * 107 *
108 * @param cls handle to use to re-connect. 108 * @param cls handle to use to re-connect.
109 * @param tc scheduler context
110 */ 109 */
111static void 110static void
112reconnect_task (void *cls, 111reconnect_task (void *cls)
113 const struct GNUNET_SCHEDULER_TaskContext *tc)
114{ 112{
115 struct GNUNET_ATS_ConnectivityHandle *ch = cls; 113 struct GNUNET_ATS_ConnectivityHandle *ch = cls;
116 114
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index 490c74cfa..48bb2ebf4 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -261,11 +261,9 @@ reconnect (struct GNUNET_ATS_PerformanceHandle *ph);
261 * Re-establish the connection to the ATS service. 261 * Re-establish the connection to the ATS service.
262 * 262 *
263 * @param cls handle to use to re-connect. 263 * @param cls handle to use to re-connect.
264 * @param tc scheduler context
265 */ 264 */
266static void 265static void
267reconnect_task (void *cls, 266reconnect_task (void *cls)
268 const struct GNUNET_SCHEDULER_TaskContext *tc)
269{ 267{
270 struct GNUNET_ATS_PerformanceHandle *ph = cls; 268 struct GNUNET_ATS_PerformanceHandle *ph = cls;
271 269
diff --git a/src/ats/ats_api_scanner.c b/src/ats/ats_api_scanner.c
index 3ed0924fe..d9002a076 100644
--- a/src/ats/ats_api_scanner.c
+++ b/src/ats/ats_api_scanner.c
@@ -297,11 +297,9 @@ interface_proc (void *cls,
297 * Periodically get list of network addresses from our interfaces. 297 * Periodically get list of network addresses from our interfaces.
298 * 298 *
299 * @param cls closure 299 * @param cls closure
300 * @param tc Task context
301 */ 300 */
302static void 301static void
303get_addresses (void *cls, 302get_addresses (void *cls)
304 const struct GNUNET_SCHEDULER_TaskContext *tc)
305{ 303{
306 struct GNUNET_ATS_InterfaceScanner *is = cls; 304 struct GNUNET_ATS_InterfaceScanner *is = cls;
307 305
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index d26841878..0d0d102db 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -166,11 +166,9 @@ reconnect (struct GNUNET_ATS_SchedulingHandle *sh);
166 * Re-establish the connection to the ATS service. 166 * Re-establish the connection to the ATS service.
167 * 167 *
168 * @param cls handle to use to re-connect. 168 * @param cls handle to use to re-connect.
169 * @param tc scheduler context
170 */ 169 */
171static void 170static void
172reconnect_task (void *cls, 171reconnect_task (void *cls)
173 const struct GNUNET_SCHEDULER_TaskContext *tc)
174{ 172{
175 struct GNUNET_ATS_SchedulingHandle *sh = cls; 173 struct GNUNET_ATS_SchedulingHandle *sh = cls;
176 174
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 3cadb2ef7..613df52ad 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -216,7 +216,7 @@ GNUNET_ATS_solver_logging_now (struct LoggingHandle *l)
216 216
217 217
218static void 218static void
219logging_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 219logging_task (void *cls)
220{ 220{
221 struct LoggingHandle *l = cls; 221 struct LoggingHandle *l = cls;
222 222
@@ -590,7 +590,7 @@ get_property (struct PropertyGenerator *pg)
590 590
591 591
592static void 592static void
593set_prop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 593set_prop_task (void *cls)
594{ 594{
595 struct PropertyGenerator *pg = cls; 595 struct PropertyGenerator *pg = cls;
596 struct TestPeer *p; 596 struct TestPeer *p;
@@ -858,9 +858,9 @@ get_preference (struct PreferenceGenerator *pg)
858 return pref_value; 858 return pref_value;
859} 859}
860 860
861
861static void 862static void
862set_feedback_task (void *cls, 863set_feedback_task (void *cls)
863 const struct GNUNET_SCHEDULER_TaskContext *tc)
864{ 864{
865 struct PreferenceGenerator *pg = cls; 865 struct PreferenceGenerator *pg = cls;
866 struct TestPeer *p; 866 struct TestPeer *p;
@@ -934,8 +934,7 @@ set_feedback_task (void *cls,
934 934
935 935
936static void 936static void
937set_pref_task (void *cls, 937set_pref_task (void *cls)
938 const struct GNUNET_SCHEDULER_TaskContext *tc)
939{ 938{
940 struct PreferenceGenerator *pg = cls; 939 struct PreferenceGenerator *pg = cls;
941 struct TestPeer *p; 940 struct TestPeer *p;
@@ -2124,10 +2123,12 @@ load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
2124 return e_counter; 2123 return e_counter;
2125} 2124}
2126 2125
2126
2127static void 2127static void
2128timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 2128timeout_experiment (void *cls)
2129{ 2129{
2130 struct Experiment *e = cls; 2130 struct Experiment *e = cls;
2131
2131 e->experiment_timeout_task = NULL; 2132 e->experiment_timeout_task = NULL;
2132 fprintf (stderr, "Experiment timeout!\n"); 2133 fprintf (stderr, "Experiment timeout!\n");
2133 2134
@@ -2487,10 +2488,12 @@ static void enforce_episode (struct Episode *ep)
2487 } 2488 }
2488} 2489}
2489 2490
2491
2490static void 2492static void
2491timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 2493timeout_episode (void *cls)
2492{ 2494{
2493 struct Experiment *e = cls; 2495 struct Experiment *e = cls;
2496
2494 e->episode_timeout_task = NULL; 2497 e->episode_timeout_task = NULL;
2495 if (NULL != e->ep_done_cb) 2498 if (NULL != e->ep_done_cb)
2496 e->ep_done_cb (e->cur); 2499 e->ep_done_cb (e->cur);
diff --git a/src/ats/gnunet-service-ats.c b/src/ats/gnunet-service-ats.c
index 11db62e2d..7b8dfe222 100644
--- a/src/ats/gnunet-service-ats.c
+++ b/src/ats/gnunet-service-ats.c
@@ -124,11 +124,9 @@ client_disconnect_handler (void *cls,
124 * Task run during shutdown. 124 * Task run during shutdown.
125 * 125 *
126 * @param cls unused 126 * @param cls unused
127 * @param tc unused
128 */ 127 */
129static void 128static void
130cleanup_task (void *cls, 129cleanup_task (void *cls)
131 const struct GNUNET_SCHEDULER_TaskContext *tc)
132{ 130{
133 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 131 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
134 "ATS shutdown initiated\n"); 132 "ATS shutdown initiated\n");
diff --git a/src/ats/gnunet-service-ats_preferences.c b/src/ats/gnunet-service-ats_preferences.c
index b56a8fd7f..c835b026b 100644
--- a/src/ats/gnunet-service-ats_preferences.c
+++ b/src/ats/gnunet-service-ats_preferences.c
@@ -388,11 +388,9 @@ age_values (void *cls,
388 * Reduce absolute preferences since they got old. 388 * Reduce absolute preferences since they got old.
389 * 389 *
390 * @param cls unused 390 * @param cls unused
391 * @param tc context
392 */ 391 */
393static void 392static void
394preference_aging (void *cls, 393preference_aging (void *cls)
395 const struct GNUNET_SCHEDULER_TaskContext *tc)
396{ 394{
397 struct AgeContext ac; 395 struct AgeContext ac;
398 396
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c
index 0f02fe34a..766a9936d 100644
--- a/src/ats/plugin_ats_ril.c
+++ b/src/ats/plugin_ats_ril.c
@@ -1513,10 +1513,9 @@ ril_step (struct GAS_RIL_Handle *solver);
1513 * no further step is scheduled. 1513 * no further step is scheduled.
1514 * 1514 *
1515 * @param cls the solver handle 1515 * @param cls the solver handle
1516 * @param tc the task context for the scheduler
1517 */ 1516 */
1518static void 1517static void
1519ril_step_scheduler_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1518ril_step_scheduler_task (void *cls)
1520{ 1519{
1521 struct GAS_RIL_Handle *solver = cls; 1520 struct GAS_RIL_Handle *solver = cls;
1522 1521
diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c
index 6592cded1..b0c42ac3d 100644
--- a/src/ats/test_ats_lib.c
+++ b/src/ats/test_ats_lib.c
@@ -279,11 +279,9 @@ find_address_information (const struct GNUNET_HELLO_Address *addr)
279 * Task run to terminate the testcase. 279 * Task run to terminate the testcase.
280 * 280 *
281 * @param cls NULL 281 * @param cls NULL
282 * @param tc unused
283 */ 282 */
284static void 283static void
285end (void *cls, 284end (void *cls)
286 const struct GNUNET_SCHEDULER_TaskContext *tc)
287{ 285{
288 if (0 != ret) 286 if (0 != ret)
289 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 287 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -335,11 +333,9 @@ end (void *cls,
335 * Main interpreter loop. Runs the steps of the test. 333 * Main interpreter loop. Runs the steps of the test.
336 * 334 *
337 * @param cls NULL 335 * @param cls NULL
338 * @param tc unused
339 */ 336 */
340static void 337static void
341interpreter (void *cls, 338interpreter (void *cls);
342 const struct GNUNET_SCHEDULER_TaskContext *tc);
343 339
344 340
345/** 341/**
@@ -591,11 +587,9 @@ reservation_cb (void *cls,
591 * Main interpreter loop. Runs the steps of the test. 587 * Main interpreter loop. Runs the steps of the test.
592 * 588 *
593 * @param cls NULL 589 * @param cls NULL
594 * @param tc unused
595 */ 590 */
596static void 591static void
597interpreter (void *cls, 592interpreter (void *cls)
598 const struct GNUNET_SCHEDULER_TaskContext *tc)
599 593
600{ 594{
601 struct Command *cmd; 595 struct Command *cmd;