On Tue, 29 Nov 2005, Alan Stern wrote:

> Greg:
> 
> This patch (as612) removes the "volatile" declarations from the 
> file-storage gadget.  It turns out that they aren't needed for anything 
> much; adding a few memory barriers does a sufficient job.
> 
> The patch also removes a wait_queue.  Not much point having a queue when 
> only one task is ever going to be on it!

Alan, is there a point in removing wait_queue? Doing manual 
sleep will add code, while binary size shouldn't shrink much 
as wait_queue_head_t is not a big structure.


>       /* Wait until a signal arrives or we are woken up */
> -     rc = wait_event_interruptible(fsg->thread_wqh,
> -                     fsg->thread_wakeup_needed);
> +     for (;;) {
> +             try_to_freeze();
> +             set_current_state(TASK_INTERRUPTIBLE);
> +             if (signal_pending(current)) {
> +                     rc = -EINTR;
> +                     break;
> +             }
> +             if (fsg->thread_wakeup_needed)
> +                     break;
> +             schedule();
> +     }
> +     __set_current_state(TASK_RUNNING);
>       fsg->thread_wakeup_needed = 0;
> -     try_to_freeze();
> -     return (rc ? -EINTR : 0);
> +     return rc;
>  }

Olav


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to