Пример #1
0
bool
Rcu_data::do_batch()
{
  int count = 0;
  bool need_resched = false;
  for (Rcu_list::Const_iterator l = _d.begin(); l != _d.end();)
    {
      Rcu_item *i = *l;
      ++l;

      need_resched |= i->_call_back(i);
      ++count;
    }

  // XXX: I do not know why this and the former stuff is w/o cpu lock
  //      but the couting needs it?
  _d.clear();

  // XXX: we use clear, we seemingly worked through the whole list
  //_d.head(l);

    {
      auto guard = lock_guard(cpu_lock);
      _len -= count;
    }

  return need_resched;
}
Пример #2
0
bool
Rcu_data::do_batch()
{
  int count = 0;
  bool need_resched = false;
  for (Rcu_list::Const_iterator l = _d.begin(); l != _d.end();)
    {
      Rcu_item *i = *l;
      ++l;

      need_resched |= i->_call_back(i);
      ++count;
    }

  // XXX: I do not know why this and the former stuff is w/o cpu lock
  //      but the couting needs it ?
  _d.clear();

  // XXX: we use clear, we seemingly worked through the whole list
  //_d.head(l);

    {
      auto guard = lock_guard(cpu_lock);
      _len -= count;
    }
#if 0
  if (_d.full())
    {
      Timeout *t = &_rcu_timeout.cpu(_cpu);
      t->set(t->get_timeout(0) + Rcu::Period, _cpu);
    }
#endif
  return need_resched;
}