summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-12-15 19:57:08 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-12-15 19:57:08 +0000
commit5334379cd470287da263bd19903022e36c255e55 (patch)
tree62134e39f38de768b803bcd60a22888fcc07a93a
parentc8d45e0b1c7e2ecb9fa723e9fec6b5d6651ab991 (diff)
downloadrockbox-5334379cd470287da263bd19903022e36c255e55.tar.gz
rockbox-5334379cd470287da263bd19903022e36c255e55.zip
Add comments source comments about the behavior of yield and sleep.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31288 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/kernel.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c
index b8556ce214..155205749f 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -224,6 +224,17 @@ void timeout_register(struct timeout *tmo, timeout_cb_type callback,
224/**************************************************************************** 224/****************************************************************************
225 * Thread stuff 225 * Thread stuff
226 ****************************************************************************/ 226 ****************************************************************************/
227
228/* Suspends a thread's execution for at least the specified number of ticks.
229 * May result in CPU core entering wait-for-interrupt mode if no other thread
230 * may be scheduled.
231 *
232 * NOTE: sleep(0) sleeps until the end of the current tick
233 * sleep(n) that doesn't result in rescheduling:
234 * n <= ticks suspended < n + 1
235 * n to n+1 is a lower bound. Other factors may affect the actual time
236 * a thread is suspended before it runs again.
237 */
227unsigned sleep(unsigned ticks) 238unsigned sleep(unsigned ticks)
228{ 239{
229 /* In certain situations, certain bootloaders in particular, a normal 240 /* In certain situations, certain bootloaders in particular, a normal
@@ -237,6 +248,9 @@ unsigned sleep(unsigned ticks)
237 return 0; 248 return 0;
238} 249}
239 250
251/* Elects another thread to run or, if no other thread may be made ready to
252 * run, immediately returns control back to the calling thread.
253 */
240void yield(void) 254void yield(void)
241{ 255{
242 /* In certain situations, certain bootloaders in particular, a normal 256 /* In certain situations, certain bootloaders in particular, a normal