| 2764 | } |
| 2765 | |
| 2766 | static void request(struct ArrowAsyncProducer* producer, int64_t n) { |
| 2767 | auto* self = reinterpret_cast<State*>(producer->private_data); |
| 2768 | { |
| 2769 | std::lock_guard<std::mutex> lock(self->mutex_); |
| 2770 | if (!self->error_.ok()) { |
| 2771 | return; |
| 2772 | } |
| 2773 | self->pending_requests_ += n; |
| 2774 | } |
| 2775 | self->cv_.notify_all(); |
| 2776 | } |
| 2777 | |
| 2778 | static void cancel(struct ArrowAsyncProducer* producer) { |
| 2779 | auto* self = reinterpret_cast<State*>(producer->private_data); |