| 62 | } |
| 63 | |
| 64 | void AsyncXQueue::Wait(std::shared_ptr<HwCommand> hw_cmd) |
| 65 | { |
| 66 | if (!hw_cmd->Synchronizable()) { |
| 67 | // If it is not synchronizable, it can only be synced |
| 68 | // by waiting its state turns to kCommandStateCompleted. |
| 69 | hw_cmd->WaitUntil(kCommandStateCompleted); |
| 70 | return; |
| 71 | } |
| 72 | |
| 73 | // Check if it is already completed. |
| 74 | if (hw_cmd->GetState() >= kCommandStateCompleted) return; |
| 75 | |
| 76 | // If this HwCommand is synchronizable, then use launch worker to sync it. |
| 77 | hw_cmd->WaitUntil(kCommandStateInFlight); |
| 78 | launch_worker_->SyncCmd(hw_cmd); |
| 79 | } |
| 80 | |
| 81 | XQueueState AsyncXQueue::Query() |
| 82 | { |
no test coverage detected