Is below code race free?

void process_context_function(void)
{
    /* interrupts enabled here */
    spin_lock(&lock);
    modify_critical_section_list();
    spin_unlock(&lock);
}

irqreturn_t a2091_intr (int irq, void *_instance)
{
    if(spin_trylock(&lock)) {
        modify_critical_section_list();
        spin_unlock(&lock);
    }
    else {
       /* skip */
    }
                
    return IRQ_HANDLED;
}


More specifically, can spin_lock & spin_trylock have race?

Regards
Lal

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to