@@ -112,7 +112,7 @@ struct SourceNode : ExecNode {
112112 lock.unlock ();
113113
114114 return generator_ ().Then (
115- [= ](const std::optional<ExecBatch>& maybe_morsel)
115+ [this ](const std::optional<ExecBatch>& maybe_morsel)
116116 -> Future<ControlFlow<int >> {
117117 std::unique_lock<std::mutex> lock (mutex_);
118118 if (IsIterationEnd (maybe_morsel) || stop_requested_) {
@@ -131,22 +131,23 @@ struct SourceNode : ExecNode {
131131 bit_util::CeilDiv (morsel_length, ExecPlan::kMaxBatchSize ));
132132 batch_count_ += num_batches;
133133 }
134- RETURN_NOT_OK (plan_->ScheduleTask ([=]() {
135- int64_t offset = 0 ;
136- do {
137- int64_t batch_size = std::min<int64_t >(
138- morsel_length - offset, ExecPlan::kMaxBatchSize );
139- // In order for the legacy batching model to work we must
140- // not slice batches from the source
141- if (use_legacy_batching) {
142- batch_size = morsel_length;
143- }
144- ExecBatch batch = morsel.Slice (offset, batch_size);
145- offset += batch_size;
146- outputs_[0 ]->InputReceived (this , std::move (batch));
147- } while (offset < morsel.length );
148- return Status::OK ();
149- }));
134+ RETURN_NOT_OK (plan_->ScheduleTask (
135+ [this , use_legacy_batching, morsel, morsel_length]() {
136+ int64_t offset = 0 ;
137+ do {
138+ int64_t batch_size = std::min<int64_t >(
139+ morsel_length - offset, ExecPlan::kMaxBatchSize );
140+ // In order for the legacy batching model to work we must
141+ // not slice batches from the source
142+ if (use_legacy_batching) {
143+ batch_size = morsel_length;
144+ }
145+ ExecBatch batch = morsel.Slice (offset, batch_size);
146+ offset += batch_size;
147+ outputs_[0 ]->InputReceived (this , std::move (batch));
148+ } while (offset < morsel.length );
149+ return Status::OK ();
150+ }));
150151 lock.lock ();
151152 if (!backpressure_future_.is_finished ()) {
152153 EVENT (span_, " Source paused due to backpressure" );
@@ -155,7 +156,7 @@ struct SourceNode : ExecNode {
155156 }
156157 return Future<ControlFlow<int >>::MakeFinished (Continue ());
157158 },
158- [= ](const Status& error) -> ControlFlow<int > {
159+ [this ](const Status& error) -> ControlFlow<int > {
159160 outputs_[0 ]->ErrorReceived (this , error);
160161 return Break (batch_count_);
161162 },
0 commit comments