pitrou commented on code in PR #46711:
URL: https://github.com/apache/arrow/pull/46711#discussion_r2140691888
##########
cpp/src/arrow/util/async_util.cc:
##########
@@ -316,15 +316,11 @@ class ThrottledAsyncTaskSchedulerImpl
#endif
queue_->Push(std::move(task));
lk.unlock();
- maybe_backoff->AddCallback(
- [weak_self = std::weak_ptr<ThrottledAsyncTaskSchedulerImpl>(
- shared_from_this())](const Status& st) {
- if (st.ok()) {
- if (auto self = weak_self.lock()) {
- self->ContinueTasks();
- }
- }
- });
+ maybe_backoff->AddCallback([weak_self = weak_from_this()](const Status&
st) {
Review Comment:
Yes. `weak_from_this` is much nicer than the pre-C++17 incantation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]