Search Linux Wireless

Re: [PATCH] ath6kl: Add rx workqueue for SDIO

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

 



On 9 March 2013 01:27, Kalle Valo <kvalo@xxxxxxxxxxxxxxxx> wrote:

> I think to fix the race the queue should be consumed something like
> this (pseudo code):
>
> lock()
> while (!list_empty()) {
>       entry = list_first_entry()
>       unlock()
>
>       do_stuff()
>
>       lock()
> }

Well, sure, but you should then re-check all the state that may have
changed when you reacquire that lock. :-)

Another way of doing it is:

init temp list
lock()
copy list to temp list
unlock()
while (! temp list empty) {
    do_stuff()
}

That way you don't have that constant unlock/relock going on.


Adrian
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux