示例#1
0
// Currently only AAWH utilizes this to handle failures.
void AsioBlockableChain::removeFromChain(AsioBlockable* ab) {
  AsioBlockable* prev = nullptr;
  for (AsioBlockable* cur = m_firstParent, *next; cur; cur = next) {
    next = cur->getNextParent();
    if (ab == cur) {
      // Found the AAWH we need to remove
      assert(cur->getKind() == Kind::AwaitAllWaitHandleNode);
      if (prev == nullptr) {
        m_firstParent = next;
      } else {
        prev->updateNextParent(next);
      }
      return;
    }
    prev = cur;
  }
  // We should always be able to find the parent.
  assert(false);
}