コード例 #1
0
ファイル: Alarm.cpp プロジェクト: epatel/Cosa
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);
}
コード例 #2
0
ファイル: Alarm.cpp プロジェクト: rrobinet/Cosa
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);
}