src/ssx/ssx/ssx_timer_core.c
// This is the kernel version of ssx_timer_cancel().
//
// This routine is used here and by thread and semaphore routines.
// Noncritical interrupts must be disabled at entry.
//
// If the timer is active, then there is a special case if we are going to
// delete the 'cursor' - that is the timer that __ssx_timer_handler() is going
// to handle next.  In this case we need to move the cursor to the next timer
// in the queue.
//
//  Note that cancelling a timer does not cause a re-evaluation of the next
//  timeout.  This will happen naturally when the current timeout expires.
This is the kernel version of ssx_timer_cancel().
This routine is used here and by thread and semaphore routines.
Noncritical interrupts must be disabled at entry.

If the timer is active, then there is a special case if we are going to
delete the 'cursor' - that is the timer that __ssx_timer_handler() is going
to handle next.  In this case we need to move the cursor to the next timer
in the queue.

Note that cancelling a timer does not cause a re-evaluation of the next
timeout.  This will happen naturally when the current timeout expires.
This is the kernel version of ssx_timer_cancel () . This routine is used here and by thread and semaphore routines . Noncritical interrupts must be disabled at entry . If the timer is active then there is a special case if we are going to delete the ' cursor ' - that is the timer that __ssx_timer_handler () is going to handle next . In this case we need to move the cursor to the next timer in the queue . Note that cancelling a timer does not cause a re - evaluation of the next timeout . This will happen naturally when the current timeout expires .
int
__ssx_timer_cancel(SsxTimer* timer)
{
    int rc;
    SsxDeque* timer_deque = (SsxDeque*)timer;
    SsxTimeQueue* tq = &__ssx_time_queue;
    if (!timer_active(timer))
    {
        rc = -SSX_TIMER_NOT_ACTIVE;
    }
    else
    {
        if (timer_deque == tq->cursor)
        {
            tq->cursor = tq->cursor->next;
        }
        ssx_deque_delete(timer_deque);
        rc = 0;
    }
    return rc;
}
int __ssx_timer_cancel ( SsxTimer * timer ) { int rc ; SsxDeque * timer_deque = ( SsxDeque * ) timer ; SsxTimeQueue * tq = & __ssx_time_queue ; if ( ! timer_active ( timer ) ) { rc = - SSX_TIMER_NOT_ACTIVE ; } else { if ( timer_deque == tq -> cursor ) { tq -> cursor = tq -> cursor -> next ; } ssx_deque_delete ( timer_deque ) ; rc = 0 ; } return rc ; }
This is the kernel version of ssx_timer_cancel().
This is the kernel version of ssx_timer_cancel () .