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/datastore/perf_datastore_api.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/datastore/perf_datastore_api.c')
-rw-r--r-- | src/datastore/perf_datastore_api.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index e430bfe93..41cac1283 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c | |||
@@ -186,11 +186,9 @@ struct CpsRunContext | |||
186 | * depending on the current state. | 186 | * depending on the current state. |
187 | * | 187 | * |
188 | * @param cls the `struct CpsRunContext` | 188 | * @param cls the `struct CpsRunContext` |
189 | * @param tc scheduler context (unused) | ||
190 | */ | 189 | */ |
191 | static void | 190 | static void |
192 | run_continuation (void *cls, | 191 | run_continuation (void *cls); |
193 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
194 | 192 | ||
195 | 193 | ||
196 | /** | 194 | /** |
@@ -344,18 +342,18 @@ delete_value (void *cls, | |||
344 | * depending on the current state. | 342 | * depending on the current state. |
345 | * | 343 | * |
346 | * @param cls the `struct CpsRunContext` | 344 | * @param cls the `struct CpsRunContext` |
347 | * @param tc scheduler context (unused) | ||
348 | */ | 345 | */ |
349 | static void | 346 | static void |
350 | run_continuation (void *cls, | 347 | run_continuation (void *cls) |
351 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
352 | { | 348 | { |
353 | struct CpsRunContext *crc = cls; | 349 | struct CpsRunContext *crc = cls; |
354 | size_t size; | 350 | size_t size; |
355 | static struct GNUNET_HashCode key; | 351 | static struct GNUNET_HashCode key; |
356 | static char data[65536]; | 352 | static char data[65536]; |
357 | char gstr[128]; | 353 | char gstr[128]; |
354 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
358 | 355 | ||
356 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
359 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 357 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
360 | crc->phase = RP_ERROR; | 358 | crc->phase = RP_ERROR; |
361 | ok = (int) crc->phase; | 359 | ok = (int) crc->phase; |