| 2781 | } |
| 2782 | |
| 2783 | static void cancel(struct ArrowAsyncProducer* producer) { |
| 2784 | auto* self = reinterpret_cast<State*>(producer->private_data); |
| 2785 | { |
| 2786 | std::lock_guard<std::mutex> lock(self->mutex_); |
| 2787 | if (!self->error_.ok()) { |
| 2788 | return; |
| 2789 | } |
| 2790 | self->error_ = Status::Cancelled("Consumer requested cancellation"); |
| 2791 | } |
| 2792 | self->cv_.notify_all(); |
| 2793 | } |
| 2794 | |
| 2795 | static int extract_data(struct ArrowAsyncTask* task, struct ArrowDeviceArray* out) { |
| 2796 | std::unique_ptr<PrivateTaskData> private_data{ |