| 1431 | } |
| 1432 | |
| 1433 | void AsyncPipeline::afterWrite(AsyncBufferView::ID bufferID) |
| 1434 | { |
| 1435 | // Decrement reference count of the buffer that was just written |
| 1436 | source->getBuffersPool().unrefBuffer(bufferID); |
| 1437 | |
| 1438 | const bool drainedPendingWrites = retryPendingWrites(); |
| 1439 | if (not drainedPendingWrites) |
| 1440 | { |
| 1441 | return; |
| 1442 | } |
| 1443 | |
| 1444 | if (shouldEndWhenDrained) |
| 1445 | { |
| 1446 | if (source != nullptr and source->hasQueuedData()) |
| 1447 | { |
| 1448 | source->resumeReading(); |
| 1449 | return; |
| 1450 | } |
| 1451 | shouldEndWhenDrained = false; |
| 1452 | endPipes(); |
| 1453 | return; |
| 1454 | } |
| 1455 | |
| 1456 | // Try resume in reverse |
| 1457 | for (size_t idx = 0; idx < MaxTransforms; ++idx) |
| 1458 | { |
| 1459 | AsyncDuplexStream* transform = transforms[MaxTransforms - 1 - idx]; |
| 1460 | if (transform) |
| 1461 | { |
| 1462 | transform->resumeWriting(); |
| 1463 | transform->resumeReading(); |
| 1464 | } |
| 1465 | } |
| 1466 | source->resumeReading(); |
| 1467 | } |
| 1468 | |
| 1469 | void AsyncPipeline::dispatchToPipes(AsyncBufferView::ID bufferID) |
| 1470 | { |
nothing calls this directly
no test coverage detected