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