Andrew Morton <[EMAIL PROTECTED]> wrote:
>
> take_the_lock()
> {
> if (sem_holder == current) {
> sem_depth++;
> } else {
> down(&sem);
> sem_holder = current;
> }
> }
>
> drop_the_lock()
> {
> if (--sem_depth == 0) {
> sem_holder = NULL;
> up(&sem);
> }
> }
>
> or something like that.
But note that it would be preferable to deisgn the code in such
a manner that the above trick is not needed - apart from lock_kernel()
we've never had a need for such a thing anywhere else in the kernel.
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel