ChangeSet 1.1743, 2004/05/18 15:49:36-07:00, [EMAIL PROTECTED]

Add msleep function to the kernel core to prevent duplication.


 include/linux/delay.h |    2 ++
 kernel/timer.c        |   17 +++++++++++++++++
 2 files changed, 19 insertions(+)


diff -Nru a/include/linux/delay.h b/include/linux/delay.h
--- a/include/linux/delay.h     Tue May 18 17:06:34 2004
+++ b/include/linux/delay.h     Tue May 18 17:06:34 2004
@@ -38,4 +38,6 @@
 #define ndelay(x)      udelay(((x)+999)/1000)
 #endif
 
+void msleep(unsigned int msecs);
+
 #endif /* defined(_LINUX_DELAY_H) */
diff -Nru a/kernel/timer.c b/kernel/timer.c
--- a/kernel/timer.c    Tue May 18 17:06:34 2004
+++ b/kernel/timer.c    Tue May 18 17:06:34 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%62&alloc_ida84&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