1
0
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:
Christian Mehlis 2013-10-17 15:25:43 +02:00
parent 269171a99f
commit 495246d2d4
2 changed files with 15 additions and 0 deletions

View File

@ -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.
*/

View File

@ -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()) {