mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #246 from mehlis/thread-name
add thread_getname function
This commit is contained in:
commit
26b2461cf9
@ -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