| 2793 | } |
| 2794 | |
| 2795 | static int extract_data(struct ArrowAsyncTask* task, struct ArrowDeviceArray* out) { |
| 2796 | std::unique_ptr<PrivateTaskData> private_data{ |
| 2797 | reinterpret_cast<PrivateTaskData*>(task->private_data)}; |
| 2798 | int ret = 0; |
| 2799 | if (out != nullptr) { |
| 2800 | auto status = ExportDeviceRecordBatch(*private_data->record_, |
| 2801 | private_data->record_->GetSyncEvent(), out); |
| 2802 | if (!status.ok()) { |
| 2803 | std::lock_guard<std::mutex> lock(private_data->producer_->mutex_); |
| 2804 | private_data->producer_->error_ = status; |
| 2805 | } |
| 2806 | } |
| 2807 | |
| 2808 | return ret; |
| 2809 | } |
| 2810 | |
| 2811 | struct ArrowAsyncDeviceStreamHandler* handler_; |
| 2812 | std::shared_ptr<State> state_; |
no test coverage detected