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