aboutsummaryrefslogtreecommitdiff
path: root/src/psyc
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/psyc
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/psyc')
-rw-r--r--src/psyc/gnunet-service-psyc.c7
-rw-r--r--src/psyc/test_psyc.c23
2 files changed, 14 insertions, 16 deletions
diff --git a/src/psyc/gnunet-service-psyc.c b/src/psyc/gnunet-service-psyc.c
index 38ec10e4d..2b436aa21 100644
--- a/src/psyc/gnunet-service-psyc.c
+++ b/src/psyc/gnunet-service-psyc.c
@@ -428,10 +428,10 @@ message_queue_drop (struct Channel *chn);
428 428
429 429
430static void 430static void
431schedule_transmit_message (void *cls, 431schedule_transmit_message (void *cls)
432 const struct GNUNET_SCHEDULER_TaskContext *tc)
433{ 432{
434 struct Channel *chn = cls; 433 struct Channel *chn = cls;
434
435 transmit_message (chn); 435 transmit_message (chn);
436} 436}
437 437
@@ -440,10 +440,9 @@ schedule_transmit_message (void *cls,
440 * Task run during shutdown. 440 * Task run during shutdown.
441 * 441 *
442 * @param cls unused 442 * @param cls unused
443 * @param tc unused
444 */ 443 */
445static void 444static void
446shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 445shutdown_task (void *cls)
447{ 446{
448 if (NULL != nc) 447 if (NULL != nc)
449 { 448 {
diff --git a/src/psyc/test_psyc.c b/src/psyc/test_psyc.c
index 4aae5e122..1169b49d5 100644
--- a/src/psyc/test_psyc.c
+++ b/src/psyc/test_psyc.c
@@ -158,10 +158,9 @@ cleanup ()
158 * Terminate the test case (failure). 158 * Terminate the test case (failure).
159 * 159 *
160 * @param cls NULL 160 * @param cls NULL
161 * @param tc scheduler context
162 */ 161 */
163void 162static void
164end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 163end_badly (void *cls)
165{ 164{
166 res = 1; 165 res = 1;
167 cleanup (); 166 cleanup ();
@@ -173,10 +172,9 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
173 * Terminate the test case (success). 172 * Terminate the test case (success).
174 * 173 *
175 * @param cls NULL 174 * @param cls NULL
176 * @param tc scheduler context
177 */ 175 */
178void 176static void
179end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 177end_normally (void *cls)
180{ 178{
181 res = 0; 179 res = 0;
182 cleanup (); 180 cleanup ();
@@ -545,8 +543,8 @@ master_history_replay_latest ()
545} 543}
546 544
547 545
548void 546static void
549transmit_resume (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 547transmit_resume (void *cls)
550{ 548{
551 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n"); 549 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n");
552 struct TransmitClosure *tmit = cls; 550 struct TransmitClosure *tmit = cls;
@@ -753,8 +751,8 @@ void first_slave_parted (void *cls)
753} 751}
754 752
755 753
756void 754static void
757schedule_slave_part (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 755schedule_slave_part (void *cls)
758{ 756{
759 GNUNET_PSYC_slave_part (slv, GNUNET_NO, first_slave_parted, NULL); 757 GNUNET_PSYC_slave_part (slv, GNUNET_NO, first_slave_parted, NULL);
760} 758}
@@ -925,8 +923,9 @@ master_start ()
925 mst_chn = GNUNET_PSYC_master_get_channel (mst); 923 mst_chn = GNUNET_PSYC_master_get_channel (mst);
926} 924}
927 925
928void 926
929schedule_master_start (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 927static void
928schedule_master_start (void *cls)
930{ 929{
931 master_start (); 930 master_start ();
932} 931}