On Tue, May 18, 2004 at 01:23:11PM -0400, Jeff Garzik wrote:
> 
> It's mostly pointless to inline delay functions :)  That was one of the 
> things I liked about the implementation you just committed to upstream, 
> that it wasn't inlined.
> 
> Stick it kernel/timer.c maybe?

Doh.  Ok, how about this?

And yes, I'll kill the usb specific version, and the other uses of
msleep in the kernel tree when I send it off to Linus.

thanks,

greg k-h

===== include/linux/wait.h 1.10 vs edited =====
--- 1.10/include/linux/wait.h   Sat May 15 04:50:38 2004
+++ edited/include/linux/wait.h Tue May 18 11:22:41 2004
@@ -258,6 +258,8 @@
                INIT_LIST_HEAD(&wait->task_list);                       \
        } while (0)
        
+void msleep(unsigned int msecs);
+
 #endif /* __KERNEL__ */
 
 #endif
===== kernel/timer.c 1.60 vs edited =====
--- 1.60/kernel/timer.c Sat May 15 04:50:38 2004
+++ edited/kernel/timer.c       Tue May 18 11:19:39 2004
@@ -1485,3 +1485,20 @@
        spin_unlock(&time_interpolator_lock);
 }
 #endif /* CONFIG_TIME_INTERPOLATION */
+
+/**
+ * msleep - sleep safely even with waitqueue interruptions
+ * msecs: Time in milliseconds to sleep for
+ */
+void msleep(unsigned int msecs)
+{
+       unsigned long timeout = msecs_to_jiffies(msecs);
+
+       while (timeout) {
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               timeout = schedule_timeout(timeout);
+       }
+}
+
+EXPORT_SYMBOL(msleep);
+


-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to