mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
add thread_getname function
This commit is contained in:
parent
269171a99f
commit
495246d2d4
@ -45,6 +45,12 @@ int thread_create(char *stack, int stacksize, char priority, int flags, void (*f
|
||||
*/
|
||||
unsigned int thread_getstatus(int pid);
|
||||
|
||||
/**
|
||||
* @brief returns the name of a process.
|
||||
* @return NULL if pid is unknown
|
||||
*/
|
||||
const char *thread_getname(int pid);
|
||||
|
||||
/**
|
||||
* @brief Puts the current thread into sleep mode. Has to be woken up externally.
|
||||
*/
|
||||
|
@ -47,6 +47,15 @@ unsigned int thread_getstatus(int pid)
|
||||
return sched_threads[pid]->status;
|
||||
}
|
||||
|
||||
const char *thread_getname(int pid)
|
||||
{
|
||||
if (sched_threads[pid] == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sched_threads[pid]->name;
|
||||
}
|
||||
|
||||
void thread_sleep()
|
||||
{
|
||||
if (inISR()) {
|
||||
|
Loading…
Reference in New Issue
Block a user