Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype for creating one timer coro per output thread #29

Open
wants to merge 12 commits into
base: s3-refactor-timer-coros-awspr-sched-exp
Choose a base branch
from
Prev Previous commit
Next Next commit
wip
  • Loading branch information
PettitWesley committed Nov 30, 2023
commit 3c5f0469b9b1fb7207b900272b64a75ca530ee3e
18 changes: 9 additions & 9 deletions plugins/out_s3/s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,15 +594,15 @@ static int cb_s3_init(struct flb_output_instance *ins,
return -1;
}

if (ctx->ins->is_threaded == FLB_TRUE) {
ctx->thread_instances = flb_calloc(1, sizeof(struct flb_out_thread_instance *) * ctx->ins->tp_workers);
if (!ctx->thread_instances) {
flb_errno();
return -1;
}
} else {
ctx->thread_instances = NULL;
}
// if (ctx->ins->is_threaded == FLB_TRUE) {
// ctx->thread_instances = flb_calloc(1, sizeof(struct flb_out_thread_instance *) * ctx->ins->tp_workers);
// if (!ctx->thread_instances) {
// flb_errno();
// return -1;
// }
// } else {
// ctx->thread_instances = NULL;
// }

/* the check against -1 is works here because size_t is unsigned
* and (int) -1 == unsigned max value
Expand Down
2 changes: 1 addition & 1 deletion plugins/out_s3/s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct flb_s3 {
* protect the array and timers_created counter.
*/
pthread_mutex_t create_timer_mutex;
struct flb_out_thread_instance **thread_instances;
struct flb_out_thread_instance *thread_instances[5];
int timers_created;

struct flb_output_instance *ins;
Expand Down
Loading