summaryrefslogtreecommitdiff
path: root/firmware/export/thread.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-03-05 17:48:06 +0000
committerThomas Martitz <kugel@rockbox.org>2011-03-05 17:48:06 +0000
commitcc889e9d608e6b07b78541849b7e63b6fb3f6058 (patch)
treeea01a47602b68561d294f705e8ab7669fb00ae9a /firmware/export/thread.h
parent0b0f99b18ebe6305c9cab12bf8b36d154fc9c87f (diff)
downloadrockbox-cc889e9d608e6b07b78541849b7e63b6fb3f6058.tar.gz
rockbox-cc889e9d608e6b07b78541849b7e63b6fb3f6058.zip
Change the thread api a bit.
* Remove THREAD_ID_CURRENT macro in favor of a thread_self() function, this allows thread functions to be simpler. * thread_self_entry() shortcut for kernel.c. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29521 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/thread.h')
-rw-r--r--firmware/export/thread.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index 0db849ab0a..d0f61f9d85 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -323,9 +323,6 @@ struct thread_entry
323#define THREAD_ID_SLOT_MASK 0x00ff 323#define THREAD_ID_SLOT_MASK 0x00ff
324#define THREAD_ID_INIT(n) ((1u << THREAD_ID_VERSION_SHIFT) | (n)) 324#define THREAD_ID_INIT(n) ((1u << THREAD_ID_VERSION_SHIFT) | (n))
325 325
326/* Specify current thread in a function taking an ID. */
327#define THREAD_ID_CURRENT ((unsigned int)-1)
328
329#ifdef HAVE_CORELOCK_OBJECT 326#ifdef HAVE_CORELOCK_OBJECT
330/* Operations to be performed just before stopping a thread and starting 327/* Operations to be performed just before stopping a thread and starting
331 a new one if specified before calling switch_thread */ 328 a new one if specified before calling switch_thread */
@@ -445,7 +442,13 @@ int thread_get_io_priority(unsigned int thread_id);
445#if NUM_CORES > 1 442#if NUM_CORES > 1
446unsigned int switch_core(unsigned int new_core); 443unsigned int switch_core(unsigned int new_core);
447#endif 444#endif
448unsigned int thread_get_current(void); 445
446/* Return the id of the calling thread. */
447unsigned int thread_self(void);
448
449/* Return the thread_entry for the calling thread.
450 * INTERNAL: Intended for use by kernel and not for programs. */
451struct thread_entry* thread_self_entry(void);
449 452
450/* Debugging info - only! */ 453/* Debugging info - only! */
451int thread_stack_usage(const struct thread_entry *thread); 454int thread_stack_usage(const struct thread_entry *thread);