diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/fs/gnunet-daemon-fsprofiler.c | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-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/fs/gnunet-daemon-fsprofiler.c')
-rw-r--r-- | src/fs/gnunet-daemon-fsprofiler.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c index 77a293a23..326178df9 100644 --- a/src/fs/gnunet-daemon-fsprofiler.c +++ b/src/fs/gnunet-daemon-fsprofiler.c | |||
@@ -267,10 +267,9 @@ make_file (uint64_t length, | |||
267 | * Task run during shutdown. | 267 | * Task run during shutdown. |
268 | * | 268 | * |
269 | * @param cls unused | 269 | * @param cls unused |
270 | * @param tc unused | ||
271 | */ | 270 | */ |
272 | static void | 271 | static void |
273 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 272 | shutdown_task (void *cls) |
274 | { | 273 | { |
275 | struct Pattern *p; | 274 | struct Pattern *p; |
276 | 275 | ||
@@ -313,10 +312,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
313 | * Task run when a publish operation should be stopped. | 312 | * Task run when a publish operation should be stopped. |
314 | * | 313 | * |
315 | * @param cls the 'struct Pattern' of the publish operation to stop | 314 | * @param cls the 'struct Pattern' of the publish operation to stop |
316 | * @param tc unused | ||
317 | */ | 315 | */ |
318 | static void | 316 | static void |
319 | publish_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 317 | publish_stop_task (void *cls) |
320 | { | 318 | { |
321 | struct Pattern *p = cls; | 319 | struct Pattern *p = cls; |
322 | 320 | ||
@@ -329,10 +327,9 @@ publish_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
329 | * Task run when a download operation should be stopped. | 327 | * Task run when a download operation should be stopped. |
330 | * | 328 | * |
331 | * @param cls the 'struct Pattern' of the download operation to stop | 329 | * @param cls the 'struct Pattern' of the download operation to stop |
332 | * @param tc unused | ||
333 | */ | 330 | */ |
334 | static void | 331 | static void |
335 | download_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 332 | download_stop_task (void *cls) |
336 | { | 333 | { |
337 | struct Pattern *p = cls; | 334 | struct Pattern *p = cls; |
338 | 335 | ||
@@ -345,10 +342,9 @@ download_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
345 | * Task run when a download operation should be stopped. | 342 | * Task run when a download operation should be stopped. |
346 | * | 343 | * |
347 | * @param cls the 'struct Pattern' of the download operation to stop | 344 | * @param cls the 'struct Pattern' of the download operation to stop |
348 | * @param tc unused | ||
349 | */ | 345 | */ |
350 | static void | 346 | static void |
351 | search_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 347 | search_stop_task (void *cls) |
352 | { | 348 | { |
353 | struct Pattern *p = cls; | 349 | struct Pattern *p = cls; |
354 | 350 | ||
@@ -498,16 +494,16 @@ progress_cb (void *cls, | |||
498 | * Start publish operation. | 494 | * Start publish operation. |
499 | * | 495 | * |
500 | * @param cls the 'struct Pattern' specifying the operation to perform | 496 | * @param cls the 'struct Pattern' specifying the operation to perform |
501 | * @param tc scheduler context | ||
502 | */ | 497 | */ |
503 | static void | 498 | static void |
504 | start_publish (void *cls, | 499 | start_publish (void *cls) |
505 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
506 | { | 500 | { |
507 | struct Pattern *p = cls; | 501 | struct Pattern *p = cls; |
508 | struct GNUNET_FS_FileInformation *fi; | 502 | struct GNUNET_FS_FileInformation *fi; |
503 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
509 | 504 | ||
510 | p->task = NULL; | 505 | p->task = NULL; |
506 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
511 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 507 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
512 | return; | 508 | return; |
513 | fi = make_file (p->x, p->y, p); | 509 | fi = make_file (p->x, p->y, p); |
@@ -523,16 +519,16 @@ start_publish (void *cls, | |||
523 | * Start download operation. | 519 | * Start download operation. |
524 | * | 520 | * |
525 | * @param cls the 'struct Pattern' specifying the operation to perform | 521 | * @param cls the 'struct Pattern' specifying the operation to perform |
526 | * @param tc scheduler context | ||
527 | */ | 522 | */ |
528 | static void | 523 | static void |
529 | start_download (void *cls, | 524 | start_download (void *cls) |
530 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
531 | { | 525 | { |
532 | struct Pattern *p = cls; | 526 | struct Pattern *p = cls; |
533 | struct GNUNET_FS_Uri *keywords; | 527 | struct GNUNET_FS_Uri *keywords; |
528 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
534 | 529 | ||
535 | p->task = NULL; | 530 | p->task = NULL; |
531 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
536 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 532 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
537 | return; | 533 | return; |
538 | keywords = make_keywords (p->x); | 534 | keywords = make_keywords (p->x); |