spin_lock & spin_trylock race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux