Qutex: nRequiredLocks==1 at front should never call backoff
This commit is contained in:
+18
-1
@@ -123,8 +123,25 @@ void Qutex::backoff(
|
||||
": backoff called on empty queue - this should never happen");
|
||||
}
|
||||
|
||||
/* Check if failedAcquirer is at the front of the queue with
|
||||
* nRequiredLocks == 1. This should never happen because an
|
||||
* acquirer at the front of the queue with nRequiredLocks == 1
|
||||
* should always succeed.
|
||||
*/
|
||||
const LockerAndInvokerBase& oldFront = *queue.front();
|
||||
if (oldFront == failedAcquirer && nRequiredLocks == 1)
|
||||
{
|
||||
lock.release();
|
||||
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) +
|
||||
": Failed acquirer is at front of queue with nRequiredLocks==1 - "
|
||||
"acquirer at front of queue with nRequiredLocks==1 should always "
|
||||
"succeed.");
|
||||
}
|
||||
|
||||
// Rotate queue members if failedAcquirer is at front of queue
|
||||
if ((*queue.front()) == failedAcquirer && nQItems > 1)
|
||||
if (oldFront == failedAcquirer && nQItems > 1)
|
||||
{
|
||||
/** EXPLANATION:
|
||||
* Rotate the top LockSet.size() items in the queue by moving
|
||||
|
||||
Reference in New Issue
Block a user