Lines Matching refs:command
28 aaudio_result_t AAudioCommandQueue::sendCommand(const std::shared_ptr<AAudioCommand>& command) { in sendCommand() argument
35 mCommands.push(command); in sendCommand()
39 std::unique_lock _cl(command->lock); in sendCommand()
40 android::base::ScopedLockAssertion lockAssertion(command->lock); in sendCommand()
42 command->operationCode, command->isWaitingForReply, command->timeoutNanoseconds); in sendCommand()
46 + std::chrono::nanoseconds(command->timeoutNanoseconds); in sendCommand()
47 while (command->isWaitingForReply) { in sendCommand()
48 if (command->conditionVariable.wait_until(_cl, timeoutExpire) in sendCommand()
50 ALOGD("Command %d time out", command->operationCode); in sendCommand()
51 command->result = AAUDIO_ERROR_TIMEOUT; in sendCommand()
52 command->isWaitingForReply = false; in sendCommand()
55 ALOGV("Command %d sent with result as %d", command->operationCode, command->result); in sendCommand()
56 return command->result; in sendCommand()
60 std::shared_ptr<AAudioCommand> command; in waitForCommand() local
76 command = mCommands.front(); in waitForCommand()
80 return command; in waitForCommand()
93 auto command = mCommands.front(); in stopWaiting() local
95 std::scoped_lock<std::mutex> _cl(command->lock); in stopWaiting()
98 if (command->isWaitingForReply) { in stopWaiting()
99 command->result = AAUDIO_ERROR_INVALID_STATE; in stopWaiting()
100 command->isWaitingForReply = false; in stopWaiting()
101 command->conditionVariable.notify_one(); in stopWaiting()