Greg KH wrote:
On Wed, Jan 19, 2005 at 01:14:07AM +0100, Thomas Winischhofer wrote:

OK, this one better?

if((retval == 0) && timeout) {
        if(sisusb->urbstatus[index] & SU_URB_BUSY) {     
           add_wait_queue(&sisusb->wait_q, &wait);
           set_current_state(TASK_INTERRUPTIBLE);
           while(1) {
             if(timeout && (sisusb->urbstatus[index] & SU_URB_BUSY)) {
                timeout = schedule_timeout(timeout);
             } else {
                set_current_state(TASK_RUNNING);
                break;
             }
           }
           remove_wait_queue(&sisusb->wait_q, &wait);
        }


Doesn't one of the many wait_event* macros work out better for this?


Probably. What I still don't understand why I get a signal 1 here sometimes. If I use the macro, signals are handled (correctly, obviously) and I get a SIGHUP without any (for me) apparent reason, aborting data transfers. Why, oh why?


Thomas


-- Thomas Winischhofer Vienna/Austria thomas AT winischhofer DOT net *** http://www.winischhofer.net/ twini AT xfree86 DOT org


------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ 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