mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Added get_name function to ThisThread namespace
							parent
							
								
									c1c94c83c5
								
							
						
					
					
						commit
						2f792a9c88
					
				| 
						 | 
				
			
			@ -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