SWDEV-295251 - Remove waitEvent check in append

Change-Id: I994f3e7c67ed29c4ee46229c8bcd1448fc7f59ec
This commit is contained in:
anusha GodavarthySurya
2021-07-26 14:26:32 -07:00
zatwierdzone przez Maneesh Gupta
rodzic 3d4fb78a45
commit de5168fdef
+13 -15
Wyświetl plik
@@ -221,23 +221,21 @@ void HostQueue::append(Command& command) {
return;
}
if (command.waitingEvent() == nullptr) {
// Set last submitted command
Command* prevLastEnqueueCommand;
command.retain();
{
// lastCmdLock_ ensures that lastEnqueueCommand() can retain the command before it is swapped
// out. We want to keep this critical section as short as possible, so the command should be
// released outside this section.
ScopedLock l(lastCmdLock_);
// Set last submitted command
Command* prevLastEnqueueCommand;
command.retain();
{
// lastCmdLock_ ensures that lastEnqueueCommand() can retain the command before it is swapped
// out. We want to keep this critical section as short as possible, so the command should be
// released outside this section.
ScopedLock l(lastCmdLock_);
prevLastEnqueueCommand = lastEnqueueCommand_;
lastEnqueueCommand_ = &command;
}
prevLastEnqueueCommand = lastEnqueueCommand_;
lastEnqueueCommand_ = &command;
}
if (prevLastEnqueueCommand != nullptr) {
prevLastEnqueueCommand->release();
}
if (prevLastEnqueueCommand != nullptr) {
prevLastEnqueueCommand->release();
}
}