| 30 | } |
| 31 | |
| 32 | AsyncXQueue::~AsyncXQueue() |
| 33 | { |
| 34 | // If the XQueue is terminated, it should not be preempted. |
| 35 | terminated_.store(true); |
| 36 | this->Resume(true); |
| 37 | |
| 38 | auto destroy_command = std::make_shared<XQueueDestroyCommand>(); |
| 39 | cmd_buf_->Enqueue(destroy_command); |
| 40 | destroy_command->Wait(); |
| 41 | SchedAgent::SendEvent(std::make_shared<XQueueDestroyEvent>(kHandle)); |
| 42 | } |
| 43 | |
| 44 | void AsyncXQueue::Submit(std::shared_ptr<HwCommand> hw_cmd) |
| 45 | { |