1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thomas Martitz 2011-03-05 17:48:06 +00:00
parent 0b0f99b18e
commit cc889e9d60
13 changed files with 67 additions and 55 deletions

View file

@ -323,9 +323,6 @@ struct thread_entry
#define THREAD_ID_SLOT_MASK 0x00ff
#define THREAD_ID_INIT(n) ((1u << THREAD_ID_VERSION_SHIFT) | (n))
/* Specify current thread in a function taking an ID. */
#define THREAD_ID_CURRENT ((unsigned int)-1)
#ifdef HAVE_CORELOCK_OBJECT
/* Operations to be performed just before stopping a thread and starting
a new one if specified before calling switch_thread */
@ -445,7 +442,13 @@ int thread_get_io_priority(unsigned int thread_id);
#if NUM_CORES > 1
unsigned int switch_core(unsigned int new_core);
#endif
unsigned int thread_get_current(void);
/* Return the id of the calling thread. */
unsigned int thread_self(void);
/* Return the thread_entry for the calling thread.
* INTERNAL: Intended for use by kernel and not for programs. */
struct thread_entry* thread_self_entry(void);
/* Debugging info - only! */
int thread_stack_usage(const struct thread_entry *thread);