src/ssx/ssx/ssx_timer_core.c
// This is the kernel version of ssx_timer_schedule().
//
// This routine is used here and by thread and semaphore routines.
// Noncritical interrupts must be disabled at entry.
//
// Unless the timer is already active it is enqueued in the doubly-linked
// timer list by inserting the timer at the end of the queue. Then the
// hardware timeout is scheduled if necessary. If the time queue 'cursor' != 0
// we are in the midst of processing the time queue, and the end of time queue
// processing will schedule the next hardware timemout.
This is the kernel version of ssx_timer_schedule().
This routine is used here and by thread and semaphore routines.
Noncritical interrupts must be disabled at entry.

Unless the timer is already active it is enqueued in the doubly-linked
timer list by inserting the timer at the end of the queue. Then the
hardware timeout is scheduled if necessary. If the time queue 'cursor' != 0
we are in the midst of processing the time queue, and the end of time queue
processing will schedule the next hardware timemout.
This is the kernel version of ssx_timer_schedule () . This routine is used here and by thread and semaphore routines . Noncritical interrupts must be disabled at entry . Unless the timer is already active it is enqueued in the doubly - linked timer list by inserting the timer at the end of the queue . Then the hardware timeout is scheduled if necessary . If the time queue ' cursor ' ! = 0 we are in the midst of processing the time queue and the end of time queue processing will schedule the next hardware timemout .
void
__ssx_timer_schedule(SsxTimer* timer)
{
    SsxTimeQueue* tq = &__ssx_time_queue;
    if (!timer_active(timer))
    {
        ssx_deque_push_back((SsxDeque*)tq, (SsxDeque*)timer);
    }
    if (timer->timeout < tq->next_timeout)
    {
        tq->next_timeout = timer->timeout;
        if (tq->cursor == 0)
        {
            __ssx_schedule_hardware_timeout(tq->next_timeout);
        }
    }
}
void __ssx_timer_schedule ( SsxTimer * timer ) { SsxTimeQueue * tq = & __ssx_time_queue ; if ( ! timer_active ( timer ) ) { ssx_deque_push_back ( ( SsxDeque * ) tq , ( SsxDeque * ) timer ) ; } if ( timer -> timeout < tq -> next_timeout ) { tq -> next_timeout = timer -> timeout ; if ( tq -> cursor == 0 ) { __ssx_schedule_hardware_timeout ( tq -> next_timeout ) ; } } }
This is the kernel version of ssx_timer_schedule().
This is the kernel version of ssx_timer_schedule () .