Exemplo n.º 1
0
void
Alarm::enable()
{
  Alarm* alarm = (Alarm*) s_queue.get_succ(); 
  while (alarm != (Alarm*) &s_queue) {
    int32_t diff = m_when - alarm->m_when;
    if (diff <= 0) break;
    alarm = (Alarm*) alarm->get_succ();
  }
  alarm->attach(this);
}
Exemplo n.º 2
0
void
Alarm::enable()
{
  // Enqueue the alarm in the schedule queue
  Alarm* alarm = (Alarm*) s_queue.get_succ();
  while (alarm != (Alarm*) &s_queue) {
    int32_t diff = m_when - alarm->m_when;
    if (UNLIKELY(diff <= 0)) break;
    alarm = (Alarm*) alarm->get_succ();
  }
  alarm->attach(this);
}