mirror of https://github.com/ARMmbed/mbed-os.git
commit
463a4536e2
|
@ -138,4 +138,13 @@ osThreadId_t ThisThread::get_id()
|
|||
return osThreadGetId();
|
||||
}
|
||||
|
||||
const char *get_name()
|
||||
{
|
||||
osThreadId_t id = osThreadGetId();
|
||||
if (id == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return osThreadGetName(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -179,6 +179,12 @@ void yield();
|
|||
*/
|
||||
osThreadId_t get_id();
|
||||
|
||||
/** Get the thread name of the current running thread.
|
||||
@return thread name pointer or NULL if thread has no name or in case of error.
|
||||
@note You cannot call this function from ISR context.
|
||||
*/
|
||||
const char *get_name();
|
||||
|
||||
};
|
||||
/** @}*/
|
||||
/** @}*/
|
||||
|
|
Loading…
Reference in New Issue