Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8365c315
Commit
8365c315
authored
May 18, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add msleep function to the kernel core to prevent duplication.
parent
b80345b7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
include/linux/delay.h
include/linux/delay.h
+2
-0
kernel/timer.c
kernel/timer.c
+17
-0
No files found.
include/linux/delay.h
View file @
8365c315
...
...
@@ -38,4 +38,6 @@ extern unsigned long loops_per_jiffy;
#define ndelay(x) udelay(((x)+999)/1000)
#endif
void
msleep
(
unsigned
int
msecs
);
#endif
/* defined(_LINUX_DELAY_H) */
kernel/timer.c
View file @
8365c315
...
...
@@ -1485,3 +1485,20 @@ unregister_time_interpolator(struct time_interpolator *ti)
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
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment