Use a dedicated lock for last queued command set/get
Change-Id: If3d2144841c7863cf7afe2ca85aea62e0a3a33c7
This commit is contained in:
@@ -192,7 +192,7 @@ bool HostQueue::isEmpty() {
|
||||
|
||||
void HostQueue::setLastQueuedCommand(Command* lastCommand) {
|
||||
// Set last submitted command
|
||||
ScopedLock sl(queueLock_);
|
||||
ScopedLock l(lastCmdLock_);
|
||||
if (lastEnqueueCommand_ != nullptr) {
|
||||
lastEnqueueCommand_->release();
|
||||
}
|
||||
@@ -204,14 +204,12 @@ void HostQueue::setLastQueuedCommand(Command* lastCommand) {
|
||||
|
||||
Command* HostQueue::getLastQueuedCommand(bool retain) {
|
||||
// Get last submitted command
|
||||
ScopedLock sl(queueLock_);
|
||||
if (lastEnqueueCommand_ == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
ScopedLock l(lastCmdLock_);
|
||||
|
||||
if (retain) {
|
||||
if (retain && lastEnqueueCommand_ != nullptr) {
|
||||
lastEnqueueCommand_->retain();
|
||||
}
|
||||
|
||||
return lastEnqueueCommand_;
|
||||
}
|
||||
|
||||
|
||||
Verwijs in nieuw issue
Block a user